How to block qmake from adding extra include paths that result in compilation failure?
-
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?
-
I don't know if it will work but you can try:
INCLUDEPATH -= ./
-
No, it doesn't. I tried 3 ways:
@INCLUDEPATH -= .
INCLUDEPATH -= ./
INCLUDEPATH -= /path/to/my/project@Qt ignores these instructions.
-
CONFIG += no_include_pwd
-
are you doing
#include "header.h"
or
#include <header.h>