Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Building Windows EXE - nmake Errors
Hi all, I'm a new user to QT and this forum. I am attempting to follow these instructions to build a Windows exe. Running the code within the IDE works. Running "qmake" within my project folder works. Running "nmake" within my project did not work. I attempted to follow these instructions and installed Visual Studio 2015. I have opened the "VS2015 x86 x64 Cross Tolls Command Prompt", navigated to my project folder, and run the "nmake" command. The command runs, but with errors, shown below. I do not know what the error means or what next steps are. I would be very grateful if someone could guide me in the right direction. Thank you.
Hi and welcome to devnet,
You are trying to build a MinGW configured project using Visual Studio's tools in a command line configured for Visual Studio rather than for MinGW.
If you really want to build your application on the command line, then you have start one configured for MinGW.
Thank you, SGaist. I would like to build a standalone exe of my project. I would like to do this in the simplest, most straightforward manner possible. The tutorial I referenced mentions using the "qmake" command first. The "qmake.exe" is found in my local MinGW bin folder: "C:\Qt\5.6\mingw49_32\bin". However, the next command referenced in the tutorial, "nmake" does not have a corresponding "nmake.exe" in this folder. Searching for a solution led me to someone suggesting installing Visual Studio, and after installing it, "nmake.exe" is found in this local folder on my computer, "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin".
I'm pretty confused by this. The MinGW bin folder does not contain "nmake.exe", which is referenced in the tutorial. Do you have any suggestions of next steps?
@mjsbbs This tutorial is based on Visual Studio. You installed MinGW. So, you need to adapt (or install Visual Studio + Qt for Visual C++ compiler). What you need to do is:
- Start MinGW console - in Start/All Programs/Qt/5.6 there should be an entry for MinGW
- Run qmake.exe
- run mingw32-make.exe
@jsulm This worked. Thank you, jsulm!