Qt Creator Not Correctly Parsing Includes
-
I am attempting to import a non-qt project using the "Import Existing Project" dialog. The project imports fine and compiles/runs with no issue. However, every single include is highlighted in red and shows a file not found error. Additionally, "Follow Symbol Under Cursor" does not work. It seems that Qt Creator is having trouble parsing the project, but I cannot figure out how to correct the issue.
-
Hi and welcome to the forum.
Did it create a .pro file from "Import Existing Project" ?
If yes, Could you show it here ?Im wondering if it needs some folder for the INCLUDEPATH
like
INCLUDEPATH = c:/msdev/include d:/stl/include
or something like that ?
Its hard to guess at with know idea about project structure and subfolders :)However, it sounds odd it compiles and runs but all includes are red.
-
Hi and welcome to the forum.
Did it create a .pro file from "Import Existing Project" ?
If yes, Could you show it here ?Im wondering if it needs some folder for the INCLUDEPATH
like
INCLUDEPATH = c:/msdev/include d:/stl/include
or something like that ?
Its hard to guess at with know idea about project structure and subfolders :)However, it sounds odd it compiles and runs but all includes are red.
-
@nlfortier
Ok, i though it would. ignore that then.
Maybe its the code model that is acting up ?
Could try disable it for a moment ?
menu: Help->About Plugins then
and restart creator. then open and see if includes are still red.
-
@nlfortier
Ok, i though it would. ignore that then.
Maybe its the code model that is acting up ?
Could try disable it for a moment ?
menu: Help->About Plugins then
and restart creator. then open and see if includes are still red.
-
@mrjj Thanks! That was helpful. I still can't use "Follow Symbol Under Cursor" on classes defined in different sub-folders, but the annoying red highlighting is gone.
@nlfortier you need to properly set up the include paths in
.includes
and add predefined macros to.config
Then it will work fine, probably even with Clang. I use it everyday in many projects.
-
@nlfortier you need to properly set up the include paths in
.includes
and add predefined macros to.config
Then it will work fine, probably even with Clang. I use it everyday in many projects.
-
I solved the issue. It turns out that I needed to add the absolute path for the root project directory to the includes file. Once I did, everything worked great.
@nlfortier ah, yes! I think you dont need the full path, but add a line with . which means current directory.
a bit annoying, but it works...