Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ Qt framework: qmake exits with error code 2, can not find project.pro file, yet it's there

Tags:

c++

qt

qt-creator

As the title says, I am having an issue with Qt Creator. I started to play with it and created a main() with a some code in it and when I wanted to compile it to see how it would appear on the screen, I am unable to do so, I see the following error:

Cannot find file: /Users/Eugene/Documents/Qt/Test/test.pro. Le processus "/Users/Eugene/QtSDK/Desktop/Qt/473/gcc/bin/qmake" terminated with error cade 2. Error during the compilation of the project Test (build : Desktop) during the step 'qmake'

Yet when I go to the folder, I can see the test.pro file there, so I don't see why Qt is unhappy.

Did anybody have had a similar problem? I couldn't find any similar question so far. Thanks in advance for you help, Regards

like image 793
Born2Discover Avatar asked Aug 29 '11 20:08

Born2Discover


People also ask

What is qmake file?

QMake is a build system that generates Makefiles for GNU Make or project build files for Microsoft Visual Studio. It is part of the Qt software framework by Trolltech. While it is commonly used to construct Qt-based software, any project can benefit from it.

Does qmake come with Qt?

qmake contains additional features to support development with Qt, automatically including build rules for moc and uic. qmake can also generate projects for Microsoft Visual studio without requiring the developer to change the project file.

How do you make a qmake project?

Building a Project For simple projects, you only need to run qmake in the top level directory of your project. By default, qmake generates a Makefile that you then use to build the project, and you can then run your platform's make tool to build the project. qmake can also be used to generate project files.


1 Answers

Are you sure that you don't have space or other 'weird' characters in your project's path? If so, Qt is unhappy.

You may also try to delete the *.pro.user file and try to compile again. If unfortunately neither of them work, you can try to compile your project on the command line.

cd to the root directory of your project and:

  1. qmake -project
  2. mingw32-make

If this still can't get your project compiled, you should check your Qt installation.

like image 200
user957121 Avatar answered Nov 14 '22 21:11

user957121