Qt World Summit: Register Today!

Compile Linux project in Windows

  • Hi, I have created a simple window with two buttons in Linux with Qt. Now I want to compile that window in Windows 10. I guess all I have to do is copy all files in the folder where my project file is from my Linux computer over to my Windows 10 computer and open that project file in Windows 10 and compile. Is that correct ?

  • You will probably need to make some changes to the .pro file, but essentially yeah that will be all it takes.

    Post your .pro file and people cna help you from there.

  • Thanks alot ndt_mike. I copied all the files to a folder in Windows 10 and I told Qt to open the .pro file but I got a message about the user file not being created on this computer and pointing to some folder locations so I figured it's a config file that told Linux where the various folders were so I told Qt to ignore that file and the project open without a hitch. I then compiled the code and the produced .exe file worked flawlessly. But after that when running the .exe outside Qt I had to manually add the required DLLs but I think this is normal for a Windows program.

    So problem solved I guess unless there is some easy way to had the DLLs automatically within the folder where the .exe is. Thank you !

  • Lifetime Qt Champion

    @JohnDoeQtUser You should not copy the *.pro.user files as they are specific for the computer on which they were created.

    To run your application outside of QtCreator (not outside of Qt, Qt is a framework, not an IDE) you need to deploy it. Use http://doc.qt.io/qt-5/windows-deployment.html

  • Thanks jsulm, I found out about the pro.user file as I've said when I first opened the .pro file, I got a warning to the effect that it was created on another system, so I won't copy it anymore. Thanks for the link, I think I understand and will study that further.

Log in to reply