[Qt-creator] How to force the code model to not inspect host system headers?

Nikolai Kosjar Nikolai.Kosjar at qt.io
Wed Jan 30 09:02:31 CET 2019


On 1/29/19 5:22 PM, Charlie Turner wrote:
> Hello,
> 
> I have imported a project from existing sources. I have passed include 
> paths in <Project>.includes to a sysroot where things like math.h should 
> be resolved to.
> 
> Instead, code model decides to take such header from my host machine, 
> which causes all sorts of problems. How can I control the code model 
> search paths?

Hi Charlie!

The kit for the project might have the wrong compiler/toolchain set.

Set up a kit for the project with the corresponding compiler. You might 
need to add the compiler manually. Put only project related include 
paths into <Project>.includes, but no toolchain paths as these will be 
picked up from the kit's compiler.

Your could also set up a kit with no compiler. In that case you would 
put toolchain paths and project-related paths into <Project>.includes 
(full control), however, then you would also need to provide all the 
necessary macros in <Project>.config (toolchain macros, project macros).

Nikolai


More information about the Qt-creator mailing list