Results 1 to 2 of 2

Thread: Creator does not use CPATH/C_INCLUDE_PATH for code parsing

  1. #1
    Join Date
    Nov 2016
    Posts
    1
    Platforms
    Unix/X11

    Default Creator does not use CPATH/C_INCLUDE_PATH for code parsing

    Hello!

    I'm using QtCreator as code editor. I added the following new env variables to project settings:

    Qt Code:
    1. CPATH = /home/alex/Сервер/Dropbox/Projects/Smilodon2/bin/
    2. C_INCLUDE_PATH = /home/alex/Сервер/Dropbox/Projects/Smilodon2/bin/
    3. LD_LIBRARY_PATH = /home/alex/Сервер/Dropbox/Projects/Smilodon2/bin/
    To copy to clipboard, switch view to plain text mode 

    Everything compiles and works well. But the QtCreator isn't able to find my header files and highlights "unknown" types as errors:

    Screenshot_30_11_2016_16_44_36.png

    This file exists (the compiler also can see it):
    Qt Code:
    1. alex@laptop:~$ ls -l /home/alex/Сервер/Dropbox/Projects/Smilodon2/bin/
    2. итого 50
    3. drwxrwx--- 1 alex alex 4096 нояб. 30 16:37 libsmilo
    4. -rwxrwx--- 1 alex alex 10493 нояб. 30 16:37 libsmilo.h
    5. lrwxrwxrwx 1 alex alex 50 нояб. 30 16:37 libsmilo.so -> libsmilo.so.0.15.9368
    6. lrwxrwxrwx 1 alex alex 50 нояб. 30 16:37 libsmilo.so.0 -> libsmilo.so.0.15.9368
    7. lrwxrwxrwx 1 alex alex 50 нояб. 30 16:37 libsmilo.so.0.15 -> libsmilo.so.0.15.9368
    8. -rwxrwx--- 1 alex alex 31385 нояб. 30 16:37 libsmilo.so.0.15.9368
    9. drwxrwx--- 1 alex alex 0 нояб. 30 16:37 tests
    To copy to clipboard, switch view to plain text mode 

    How can I ask QtCreator to follow CPATH/C_INCLUDE_PATH correctly? I *need* to use <..> brackets as my project will be installed as library. But for tests I need to deploy it locally.


    UPDATED:
    I have found that I can make it to see includes right if I start it with CPATH set variable:
    Qt Code:
    1. alex@laptop:~$ CPATH=/home/alex/Сервер/Dropbox/Projects/Smilodon2/bin /opt/Qt/Tools/QtCreator/bin/qtcreator
    To copy to clipboard, switch view to plain text mode 
    So, looks like the problem is that the creator ignores CPATH in project settings when parsing the code.
    Last edited by AlexTiger; 30th November 2016 at 15:43.

  2. #2
    Join Date
    Jan 2013
    Posts
    2
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Creator does not use CPATH/C_INCLUDE_PATH for code parsing

    What makes you think that creator should use random environment variables to feed it's code model?

    Just use a supported build system and set that up to use the proper include paths and creator will use those settings. Or if you have to use a generic project, put the include paths into the expected file.

Similar Threads

  1. Replies: 10
    Last Post: 16th June 2014, 16:40
  2. Qt Creator Source code export from Qt Creator
    By Gera777 in forum Qt Tools
    Replies: 2
    Last Post: 17th May 2013, 15:21
  3. Replies: 0
    Last Post: 25th March 2013, 01:24
  4. Qt Creator qt creator code model
    By Vanir in forum Qt Tools
    Replies: 0
    Last Post: 5th October 2010, 12:10
  5. Replies: 3
    Last Post: 22nd February 2010, 23:11

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.