Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22442

Clang Code Model has issues when OpenMP is enabled (CMake)

    XMLWordPrintable

Details

    • Linux/X11

    Description

      When I use the Armadillo libary and enable OpenMP, the Clang Code Model gives me a lot of errors in the IDE, but compilation works fine.

      Here is a minimal example

      cmake_minimum_required(VERSION 2.8)
      
      project(test-qtcreator-openmp-arma)
      add_executable(${PROJECT_NAME} "main.cpp")
      
      find_package(Armadillo REQUIRED)
      target_include_directories(${PROJECT_NAME} PRIVATE ${ARMADILLO_INCLUDE_DIRS})
      target_link_libraries(${PROJECT_NAME} ${ARMADILLO_LIBRARIES})
      
      FIND_PACKAGE(OpenMP REQUIRED)
      target_link_libraries(${PROJECT_NAME} OpenMP::OpenMP_CXX)
      
      #include <armadillo>
      
      int main()
      {
          arma::vec v;
          return 0;
      }
      

      This shows the error `no type named 'vec' in namespace 'arma'` on line 5, but compiles just fine. This can get pretty annoying when arma is used everywhere, and has made me disable the Clang Code Model completely for such projects.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kosjar Nikolai Kosjar
              FonderPrism Filip Sund
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes