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. How to block qmake from adding extra include paths that result in compilation failure?
Forum Updated to NodeBB v4.3 + New Features

How to block qmake from adding extra include paths that result in compilation failure?

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

    I try to use Qt Creator as IDE for non-Qt project. My problem is that qmake adds project root folder to include paths automatically, and it causes compilation failure for me, because my project root folder contains files which names conflict with system include file names. Such conflict, however, never causes problems with Visual C++ and Eclipse CDT, it is qmake-specific because of unwanted automatic values that Qt adds to g++ options.
    My .pro file assigns an empty string to include paths variable:

    @INCLUDEPATH =@

    However, for any reason actual command line is:

    @g++ -c -pipe -std=c++11 -g -fPIC -Wall -W -D_REENTRANT -I/path/to/my/project -I.@

    So, it looks like qmake doesn't follow my instructions and sets up some automatic include paths that result in failure. Is there any workaround? Can I force qmake to stop to add anything extra to my build settings and just follow explicit instructions?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on last edited by
      #2

      I don't know if it will work but you can try:

      INCLUDEPATH -= ./

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goodguysoft
        wrote on last edited by
        #3

        No, it doesn't. I tried 3 ways:

        @INCLUDEPATH -= .
        INCLUDEPATH -= ./
        INCLUDEPATH -= /path/to/my/project@

        Qt ignores these instructions.

        1 Reply Last reply
        0
        • E Offline
          E Offline
          esilin
          wrote on last edited by
          #4

          CONFIG += no_include_pwd

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SamiV123
            wrote on last edited by
            #5

            are you doing

            #include "header.h"

            or

            #include <header.h>

            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