Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. more include question
Forum Updated to NodeBB v4.3 + New Features

more include question

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
2 Posts 2 Posters 231 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on 10 Dec 2023, 16:17 last edited by
    #1

    When I "add project" in Subdir project, it correctly adds to "SUBDIRS".

    The result looks this way

    a6ef9298-4545-4f86-890d-4557f722e7cd-image.png

    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
    
    A 1 Reply Last reply 10 Dec 2023, 16:49
    0
    • A Anonymous_Banned275
      10 Dec 2023, 16:17

      When I "add project" in Subdir project, it correctly adds to "SUBDIRS".

      The result looks this way

      a6ef9298-4545-4f86-890d-4557f722e7cd-image.png

      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
      
      A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 10 Dec 2023, 16:49 last edited by Axel Spoerl 12 Nov 2023, 07:09
      #2

      @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.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      1
      • A Axel Spoerl referenced this topic on 10 Dec 2023, 16:51
      • A Axel Spoerl referenced this topic on 24 Jan 2024, 20:33

      1/2

      10 Dec 2023, 16:17

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved