PDA

View Full Version : #include "MathFunctions" highlights with "no such file"



framontb
1st November 2016, 20:40
Hello,
From a Qt Creator 4.1.0 Based on Qt 5.7.0 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit),
I create a library: File > New File or Project > Library > C++ Library
called "MathFunctions" and does't touch a file. So there are the skeleton files, and build them, with the release and debug flavors; all going well without errors.

Now I create another project: File > New File or Project > Application > Qt Console Application: "MathFunctionsTest"
After that, right click over the project "MathFunctionsTest" and: Add library > External library

selected: Library file; Include path; Linux
MathFunctionsTest.pro ends up with this snippet inserted:


unix:!macx: LIBS += -L$$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release/ -lMathFunctions

INCLUDEPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release
DEPENDPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release

unix:!macx: PRE_TARGETDEPS += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release/libMathFunctions.a

Now I go to main.cpp and try to add:

#include "MathFunctions"
Qt creator highlights with "no such file", but directories and files do exist.

Please, any ideas?

Regards

framontb
1st November 2016, 23:02
Solved, forget to execute "Run qmake" :p

EDIT: After changing the INCLUDEPATH line incorrectly edited by Add library > External library.

The bad one:

INCLUDEPATH += $$PWD/../../MathFunctions/build-MathFunctions-Desktop_Qt_5_7_0_GCC_64bit-Release

The good one:

INCLUDEPATH += $$PWD/../../MathFunctions/MathFunctions