Qt, there is no rule that the goal is necessary

I have a problem with my Makefile. I downloaded the open source Qt project. Therefore, when I try to compile it, I got the message: "error: No rule to make target, necessary to stop." In my .pro file, I have relative paths to * .cpp files. Therefore, when I replace the relative paths with an absolute one, this works, otherwise he received the error above. Linux system


What should I do to do this work with relative paths? Thanks in advance.

+10
source share
2 answers

I would use QtCreator by opening a project and then adding one of the non-local sources (say, the first one you see in .pro).

The IDE must host it with the correct relative path according to the folder choice. After that cut'n'paste the path prefix in all remaining places.

In any case, the path prefixes should be relative to the directory in which you will find .pro. Example from an open source project that I am using (QZXIng, Qt ZXing port):

SOURCES += CameraImageWrapper.cpp \ QZXing.cpp \ imagehandler.cpp \ zxing/ResultPointCallback.cpp \ zxing/ResultPoint.cpp \ zxing/Result.cpp \ ... 

then you try to make a .pro file, where appropriate, instead of changing the relative paths ...

NTN

+5
source

One of the reasons for this problem is that you deleted the file that you no longer need, but forgot to delete from res.qrc

+2
source

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


All Articles