Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator Clang Code Model 4.8.1 not working for cross-compile with cmake toolchain file
Forum Updated to NodeBB v4.3 + New Features

Qt Creator Clang Code Model 4.8.1 not working for cross-compile with cmake toolchain file

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
1 Posts 1 Posters 492 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hugo van den Brand
    wrote on 10 Sept 2019, 10:10 last edited by
    #1

    I use a basic QtQuick application with CMakeLists.txt generated by qtcreator.
    I configured a basic desktop kit (specifying C/CXX compiler, Qt version, standard cmake settings).
    This desktop kit works fine for building and the Code Model works as expected.

    I also a crosscompiling kit using a Yocto SDK in which I only set the sysroot (/opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi), debugger and cmake.
    As cmake arguments I have:

    CMAKE_TOOLCHAIN_FILE:INTERNAL=/opt/poky/2.2.0/sysroots/x86_64-pokysdk-linux/usr/share/cmake/OEToolchainConfig.cmake
    

    Qtcreator is able to compile with this kit, but the Clang Code model fails to find type_traits.

    By using export QT_LOGGING_RULES=qtc.clang*=true from Qt Creator Clang Code Model, I see that the include path is limited to just:

    #include "..." search starts here:
    #include <...> search starts here:
     /home/appdev/builds/build-colibtest-Embedded_ARM_GNUEABI-Default
     /home/appdev/colibtest
     /home/appdev/builds/build-colibtest-Embedded_ARM_GNUEABI-Default/colibtest_autogen/include
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtCore
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/lib/qt5/mkspecs/linux-oe-g++
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQuick
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtQml
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtNetwork
     /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/include/qt5/QtGui
     /tmp/QtCreator-DoOePy/clang-uiheader-yzrCSu
     /opt/qtcreator/libexec/qtcreator/clang/lib/clang/7.0.0/include
    End of search list.
    

    I found a similar topic on code model failure in cross compiling in which the issue is resolved by setting CMAKE_SYSROOT.

    I tried this both in the Project Build settings and by adding it to the toolchain file with either
    set( CMAKE_SYSROOT $ENV{OECORE_TARGET_SYSROOT} ) or
    set( CMAKE_SYSROOT /opt/poky/2.2.0/sysroots/cortexa9hf-neon-poky-linux-gnueabi )

    If I add it in the toolchain file I do not see CMAKE_SYSROOT in the project build settings.
    In both cases I don't see any difference in the code model behavior.

    Could this be a known issue that is resolved in a newer release or does anybody have a clue how to solve this?

    1 Reply Last reply
    0

    1/1

    10 Sept 2019, 10:10

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved