C ++ Qt framework: qmake exits with error code 2, cannot find project.pro file, but it is there

As the name says, I have a problem with Qt Creator. I started playing with it and created main () with some code in it, and when I wanted to compile it to see how it appears on the screen, I cannot do this, 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 a cade 2 error. An error occurred while compiling the Test project (build: Desktop) during the 'qmake' step

But when I go to the folder, I see the test.pro file there, so I donโ€™t understand why Qt is unhappy.

Has anyone had a similar problem? So far I have not been able to find a single similar question. Thanks in advance for your help, Relationship

+6
source share
3 answers

Are you sure you do not have a place or other โ€œstrangeโ€ characters in your path to the project? If so, then Qt is unhappy.

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

cd to the root directory of your project and:

  • qmake -project
  • mingw32-make

If this still cannot compile your project, you should check your Qt installation.

+6
source

In my case, removing non-ascii characters from the path resolved the issue. The spaces are beautiful, at least from my experience.

+2
source

I found another solution that worked for me.

QT is a cross-platform tool, so it needs limitations and limitations. One of these limitations is the correct path to the project. It CANNOT contain spaces !!!

for instance

D: \ Qt project \ project - wrong

WRONG. (notice the space between Qt and Project). Use something like this instead

D: \ Qt_project \ project - correct

+1
source

Source: https://habr.com/ru/post/896160/


All Articles