header: No such file or directory
-
Qt 4.8.4, I am trying to port a project built using cmake to a existing pro file so it can be built using Qt Creator.
Issues: (So far)
DDS_CGU_IDL.h: No such file or directory
I've double clicked on the error and it opens the header where the include has a red exclamation icon to the left, if I right click the file and choose Follow Symbol Under Cursor it does open the file its complaining about in Qt Creator.
In the pro file I have also added the relative path of the file:
INCLUDEPATH += build/common/src/cgu_idl
I've tried Run qmake then rebuilding, it still comes up with the same error, why?
-
@SPlatten said in header: No such file or directory:
#include "rti_me_cpp.hxx"
Then check where this one is located and add the folder to INCLUDEPATH.
-
@J-Hilk , thank you, I'm now sure what that means?
Sorry, I know what you mean now....however this hasn't been done for all the headers that are included and I wouldn't expect to have to do that either if the include path has been specified.
-
@SPlatten
https://doc.qt.io/qt-5/qmake-variable-reference.html#headersit defines the header of your project in your *.pro file
you know, for object file generation and linking stuff or moc, if its a QObject class
-
@J-Hilk , I've just realised that I had the wrong path in the INCLUDEPATH, which I've corrected to:
INCLUDEPATH += ../../../../build/common/src/cgu_idl
However now there is another problem because the file it was complaining about has includes another header using:
#include "rti_me_cpp.hxx"
Again, Qt Creator doesn't have a problem and will open the file if I right click, but the build process fails with the same error:
rti_me_cpp.hxx: No such file or directory
-
@SPlatten said in header: No such file or directory:
INCLUDEPATH += build/common/src/cgu_idl
You're using a relative path which can be the issue here.
Check the compiler log to see what include folders are passed to the compiler to see wheather your relative path is passed properly. -
@SPlatten said in header: No such file or directory:
#include "rti_me_cpp.hxx"
Then check where this one is located and add the folder to INCLUDEPATH.
-
@SPlatten said in header: No such file or directory:
I've just realised that I had the wrong path in the INCLUDEPATH, which I've corrected to:
INCLUDEPATH += ../../../../build/common/src/cgu_idl
I would suggest you to set include path not as relative but absolute path.
I often use project location as starting point.
Something like this:INCLUDEPATH += $$PWD/common/src/cgu_idl
or if it is relative to build path:INCLUDEPATH += $$OUT_PWD/common/src/cgu_idl