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. Include directory

Include directory

Scheduled Pinned Locked Moved Qt Creator and other tools
5 Posts 5 Posters 3.1k Views
  • 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.
  • M Offline
    M Offline
    mike4
    wrote on last edited by
    #1

    Hi
    can I include headers using a application base directory variable? Something alike:
    #include "$appBaseDir/blab/bllb.h
    Thanks
    Michael

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      It's not needed. Why do you want doing it?

      --
      Vasiliy

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fluca1978
        wrote on last edited by
        #3

        As far as I know in C/C++ you cannot. #include does not allow variable expansion. However you can achieve something like the following with a script or something alike. But I'm not sure what is your aim...

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          you can use something like this in your pro file:

          @appBaseDir = /app/dir/

          HEADERS += $${appBaseDir}/bllb.h@

          in the needed cpp or h file you just use
          @#include "bllb.h"@

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on last edited by
            #5

            Setting include paths is usually handled with the C/C++ flags. In qmake projects you add

            @
            INCLUDEPATH += $${appBaseDir}
            @

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0

            • Login

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