[Qt-creator] Code completion is unable to find header files
Orgad Shaneh
orgads at gmail.com
Mon Dec 31 11:26:40 CET 2012
Add in your pro file:
INCLUDEPATH += /usr/include/SDL
On Mon, Dec 31, 2012 at 12:19 PM, Nikos Chantziaras <realnc at gmail.com>wrote:
> I've run into a nasty problem with Qt Creator (I'm using 2.6.1 on Gentoo
> Linux) where it can't find header files I include and thus code
> completion for anything in those headers isn't working.
>
> Case in point:
>
> #include <SDL.h>
>
> Creator can't find it because the full path to that header is:
>
> /usr/include/SDL/SDL.h
>
> However, I don't want to use:
>
> #include <SDL/SDL.h>
>
> instead. That's not the correct way to do it, as it breaks portability.
> Some systems don't use "SDL/" but can have that header in "SDL1.2/" or
> "SDL12/" or "SDL-1.2/" or whatever. The correct way to do this is to
> use pkg-config. In my project file:
>
> CONFIG += link_pkgconfig
> PKGCONFIG += sdl
>
> Qt Creator is not able to pick that up. So as a workaround, which seems
> to work fine with generic projects, I provided a "ProjectName.includes"
> file with this in it:
>
> /usr/include/SDL
>
> But Creator doesn't seem to care. This works just fine for non-qmake
> projects. But with qmake projects, Creator seems to ignore *.includes
> files?
>
> What can I do?
>
> This is of course not limited to SDL. The same problem arises with
> anything that uses pkg-config to provide include paths and you're not
> supposed to hardcode the path prefix into your #include directives.
>
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qt-creator
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20121231/6196a2b5/attachment.html>
More information about the Qt-creator
mailing list