Can I get code model tips using a GCC toolchain?



  • I just recently switched from Eclipse to QT Creator, and so far I'm very happy. The biggest problem I've had so far is that the Clang Code Model plugin will give me errors about GCC symbols that are apparently undefined (I get errors such as "function-like macro '__glibc_use' is not defined"), which will keep it from parsing a header and cause it to give me false errors.

    I've currently disabled Clang Code Model so that I don't have all these false errors littering my code, but I do find it helpful when it actually works. Is there a way to get the benefits of the plugin without these problems?


  • Moderators

    Hi @nathanb, and welcome!

    Can I get code model tips using a GCC toolchain?

    Unfortunately not. GCC does not expose the details required to create a code model.

    "function-like macro '__glibc_use' is not defined"

    Do you know which header defines __GLIBC_USE()? If you explicitly include its directory in your project (e.g. INCLUDEPATH += /path/to/header), that might make Clang happy.



  • Hi @JKSH, thanks for your reply!

    I believe the GLIBC macros are from /usr/include/features.h. Is there a way to have QT Creator index that file without explicitly including it in the project? The project itself builds fine, so I'd rather not clutter up our cmake files with unnecessary directives. (The same reasoning applies to creating a clang_hacks.h that defines the GCC macros and symbols to keep clang happy).


  • Moderators

    @nathanb said in Can I get code model tips using a GCC toolchain?:

    Is there a way to have QT Creator index that file without explicitly including it in the project?

    I don't know, sorry. I'll let an experienced person reply.

    If you don't get anything from this forum, try the Qt Creator mailing list: https://lists.qt-project.org/listinfo/qt-creator (You must subscribe before posting)

    P.S. It's "Qt", not "QT". The latter stands for Apple QuickTime.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.