Build Project - MinGW
-
Hi, everyone. So, I have in a specific directory (C:\QtProjects\hello) the following files:
- Hello.cpp,
- hello.pro,
- Makefile,
- Makefile.Release,
- Makefile.Debug,
and the folders:
- debug,
- release
Inside this directory, how do I build the project using MinGW (which I have already installed)? Thanks in advance!
-
Hi and welcome to devnet,
Do you want to do it from the command line or are you using QtCreator ?
-
Thanks! From the command-line.
-
Then, call mingw32-make in the folder containing the Makefile
-
Thanks. I did that, and I got: 'g++' is not recognized as an internal or external command, operable problem or batch file. Before that, I even put the MinGW bin directory in the PATH environment variable.
-
Did you generate the Makefiles or where they given to you ?
-
I think I did that...I am reinstalling MinGW, including the C++ compiler, not only the C one. I hope this fixes the issue. I'll write here to let you know. Thanks.
-
New error: QApplication not found. The g++ error did not occur.
-
I added the whole directory C:\Qt to PATH, and I'm still getting the error of QApplication not being found.
-
Beware that if you are installing several mingw versions on your computer, you might get into trouble.
The standard way is to install the mingw environment that comes with Qt.
Also, re-run qmake on your project
-
Thanks, I guess if that doesn't work I will forget about using the command-line and do everything through the IDE. Anyway, thanks again for your support.