more include question
-
When I "add project" in Subdir project, it correctly adds to "SUBDIRS".
The result looks this way
How can I "reuse " the path to add actual " #include " in code to link with subject used as library ?
As an example , actual #include should look similar to this and intelisense should help...l
../BT_LIBRARY/CCC_SOURCE/BT_Utility_Library
Sorry it look stupid...
SUBDIRS +=
../../../../../home/nov25-1/Qt/Examples/Qt-5.15.2/widgets/mainwindows/mdi \../../../../home/nov25-1/Qt/Examples/Qt-5.15.2/widgets/mainwindows/mdi \
../BT_LIBRARY/CCC_SOURCE/BT_Utility_Library \ ../BT_LIBRARY/CCC_SOURCE/Bluetoothctl_Dialog
-
@AnneRanch
If I get this right, you want to add a library to a Subdir project.
I don't know exactly what is the structure of your project, but since you are mentioning both "include" and "library", I assume that you want to link to a library and include its header(s) in "BLUETOOTH_FT857_DEC7.pro".For that to work, it is necessary that
- the compiler knows the include path
- the linker knows, it has to link to the library and where to find it.
Qt Creator's Add Library function is a comfortable UI for that purpose. You can copy-paste (hence re-use) the paths to the header and the library.
You can also edit the .pro file manually.
In that case, you have to add the directory where the header is located to the INCLUDEPATH variable. You also have to add a linking instruction to the LIBS variable.
The linker instruction to be added to LIBS is OS specific. The documentation has a Windows and a Linux example. -
-