Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt project, no rule to make target needed by

Tags:

makefile

qt

I have a problem with my Makefile. I downloaded opensource Qt project. Hence, when I try to compile it I got a message:

error: No rule to make target needed by stop.

In my .pro file I have relative paths to *.cpp files. So when I replace relative paths to absolute it works, another case it got me with the error above. System is Linux.


What should I do to do this work with the relative paths?

like image 583
Robert Avatar asked Jun 18 '13 11:06

Robert


2 Answers

I would use QtCreator, opening the project and then adding one of the misplaced sources (let say the first you see in .pro).

The IDE should place it with the correct relative path, as appropriate per your folder choice. After that cut'n'paste the path prefix all over the remaining places.

Anyway, path prefixes should be relative to the directory where you find the .pro. An example from an opensource project I'm using (QZXIng, a Qt port of ZXing):

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

so you could try to move the .pro file where appropriate instead of changing relative paths...

HTH

like image 77
CapelliC Avatar answered Sep 16 '22 14:09

CapelliC


One reason for this issue is because you have removed a file which you no longer need but forgot remove from res.qrc

like image 20
faisal khan Avatar answered Sep 18 '22 14:09

faisal khan