How to configure Qt to make it work with the VS2015 command Prompt
-
Hello everyone !
Can you please help me to set up Qt to work with Visual Studio command prompt.
I've followed the instructions from the Qt Library, but they aren't so clear, and for some others tutorial, i didn't found the same "directories" to set up everything. (For example, i don't have the Qbase directory)I'm using Qt 5.8.
Thank you
-
@Mohamed-Fouzi What exactly is the problem?
Did you install Qt for VS2015?
When you installed VS2015 did you install C++ tools as well? -
Well, i did. I installed both of them.
Where i'm getting issues, is that i have a c++ code, that in order to make it executable, i have to compile it with the "msvc command prompt", so, when i create a Qt project containing those c/c++ files, i tried to compile in the command prompt with the following command :
cl.exe /I "path to include files" /M /Ehsrc outputFile.exe main.cpp mainwindow.cpp zcl.lib
where the zcl.lib is the library for the c++ project.
This gave me errors like : cannot open QMainWindow : file not found..
So, basically, i thought the compiling msvc "command prompt", didn't know the Qt library, this is why i concluded i have to set that manually.But,
-
@Mohamed-Fouzi If you use qmake then just do:
qmake.exe project_name.pro nmake.exe
in the command line (in the project directory) - don't call compiler directly. Probably you will need to provide the whole path to qmake.exe
-
Thank you for your answer.
I did it, but the "nmake" command wasn't recognized -
Hi,
What kind of terminal are you using to run that code ?
-
@Mohamed-Fouzi You should use the command prompt from your Visual Studio installation (you can find it in the Start menu).