April 8, 2012

fs_tigre fs_tigre
Ant Farmer
146 posts

Deploying for Windows and Mac

 

Hi,

I have created a small little app on a Mac and I was wondering what would be the steps to compile this little application to create an executable file for Windows.

I actually copied the two folders where the project resides to my Windows machine but as expected I got an error.

Error while building project applicationName(target: Desktop)
When executing build step ‘qmake’

What would be the proper procedure to create an .exe file for Windows after creating the app on a Mac?

Thanks a lot for your help!

7 replies

April 8, 2012

miroslav miroslav
Ant Farmer
228 posts

Just copying in the folder probably means that you copied all kinds of temporary files created by the Mac build along with the source code. This will not work ™. For example, Makefiles generated on Mac for the Mac C++ compiler will not work at all on Windows.

Firstly, you need to clean the source directory before copying the files over (side note: Dude, get a source code repo, there is Github and tons of other free options!).

Then run qmake on Windows on the .pro file to generate Windows build files. How to do that depends on your compiler and setup. See http://qt-project.org/doc/qt-4.8/qmake-tutorial.html for how to use QMake.

 Signature 

Mirko Boehm | .(JavaScript must be enabled to view this email address) | KDE e.V.
FSFE Fellow
Qt Certified Specialist

April 9, 2012

fs_tigre fs_tigre
Ant Farmer
146 posts

Thank you for your reply.

This is how I did it.

1-Created a new project in my Windows machine.
2-Copied the files from the project created on the Mac (main.cpp,mainwindow.cpp, mainwindow.ui etc ) and replaced the files in the Windows machine, and it did the trick.

Firstly, you need to clean the source directory before copying the files over (side note: Dude, get a source code repo, there is Github and tons of other free options!).

I do have an account but I have never use it because I don’t see how this could help me if I’m not collaborating with any body, in fact I don’t even know how to use Github.

Excuse my ignorance but what would be the benefit of using Github?

Can you please give me a quick explanation on how you use Github?

Thanks a lot

April 9, 2012

miroslav miroslav
Ant Farmer
228 posts

The benefit of using a repository is that there is a managed process of working with multiple setups and tracking changes done for the different target platforms. It is one of the first things to learn when developing code, just as important as the coding itself.

For an introduction to Github, see http://learn.github.com/p/intro.html

By the way, your initial error message looks like QMake is not in the path.

[Edit: Fixed path by removing . from the end; mlong]

 Signature 

Mirko Boehm | .(JavaScript must be enabled to view this email address) | KDE e.V.
FSFE Fellow
Qt Certified Specialist

April 9, 2012

fs_tigre fs_tigre
Ant Farmer
146 posts

Thanks a lot for your help!

I will give it a try. For some reason the link doesn’t work, but I guess my homework is to find good tutorials.

Thanks

April 9, 2012

mlong mlong
Mad Scientist
1517 posts

The link should work now.

 Signature 

Senior Software Engineer
AccuWeather Enterprise Solutions
/* My views and opinions do not necessarily reflect those of my employer.  Void where prohibited. */

April 9, 2012

fs_tigre fs_tigre
Ant Farmer
146 posts

I apreciate it. Thanks a lot!

April 10, 2012

miroslav miroslav
Ant Farmer
228 posts

Oops, sorry for the messed up path. Thanks, @mlong!

 Signature 

Mirko Boehm | .(JavaScript must be enabled to view this email address) | KDE e.V.
FSFE Fellow
Qt Certified Specialist

 
  ‹‹ Error compiling shared Qt 4.8.1 with MSVC 2010 SP1 : qmlgesturesplugin.dll      [Closed double post] How to deploy qml application on machine (Windows XP) without QtSDK ››

You must log in to post a reply. Not a member yet? Register here!