PDA

View Full Version : Problem building a .exe windows Qt app



mikea
1st October 2014, 04:07
I have been away from Qt for several years. However, I was able to port my Qt app (written a while back) to Qt 5.3/QCreator 3.1.2. Now I want to build a windows .exe file to run on the same computer containing Qt. I read that I need to do the following in my project directory.

nmake clean
make -config release
nmake

I am not sure if this is correct because I can't find nmake on my machine and don't know where to get the copy I need. I thought QCreator would build a .exe, but my efforts did not pay off.

Thanks for any suggestions,
Mike

wysota
1st October 2014, 07:47
nmake is part of visual studio, so if you are not using it, you should use make bundled with MinGW compiler that comes with Qt Creator. However it should be easiest to simply open your project in Creator, set it up and hit the build button.

mikea
1st October 2014, 17:27
wysota,

Thanks for your reply. It seems QCreator works a little different than earlier Qt Design. My pro file specified a build directory, but QCreator did not use it. Instead it made a build directory in the folder containing my project folder. Once I found it, the .exe file was there but won't run due to missing QtCore5.dll. I am not trying to do a deployment build. I thought it would find the needed .dll if running on the same machine as Qt. I guess I still need help. I'll try copying QtCore5.dll to correct system file. Doesn't seem like I should have to do that though.

Added after 19 minutes:

wysota,

I located the Qt5Core.dll and put its location in system PATH and my app runs correctly.
Thanks again.

wysota
1st October 2014, 21:23
My pro file specified a build directory, but QCreator did not use it. Instead it made a build directory in the folder containing my project folder.
That's what you told it to do when importing the project.


I thought it would find the needed .dll if running on the same machine as Qt.
Windows doesn't do that, really. It looks in the system path and in the directory containing the executable. Qt has nothing to do with that.