Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. QtCreator 10 and C++20 modules
Qt 6.12 LTS is out! See what's new in the release blog

QtCreator 10 and C++20 modules

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
8 Posts 3 Posters 4.3k Views 2 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.
  • D Offline
    D Offline
    devloop
    wrote on last edited by
    #1

    Is it possible to use Qt Creator 10, on Linux, with CMake 3.26.4 and Clang 16 or Clang 17?

    Because I can build code with modules from terminal, but Clang complains that it: Could not build module 'std', as soon as I add module;.

    1 Reply Last reply
    0
    • D devloop

      @SGaist

      Knowing that the CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API have to be changed, according to some setup, etc., yes, I can build, from a terminal, with this kind of configuration, for instance with a command like cmake -GNinja ..

      But it does not work with Qt Creator.

      Indeed, as soon as I add any line related to modules, like module; I get an error from Qt Creator: Could not build module 'std'.

      98f1337b-ec3d-4834-ac13-a5a5e0c58a74-image.png

      O Offline
      O Offline
      odelaune
      wrote on last edited by
      #6

      @devloop said in QtCreator 10 and C++20 modules:

      module

      It is probably related to QTCREATORBUG-28465.

      D 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi and welcome to devnet,

        Did you enable C++ 20 in your CMakeLists.txt ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        D 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi and welcome to devnet,

          Did you enable C++ 20 in your CMakeLists.txt ?

          D Offline
          D Offline
          devloop
          wrote on last edited by
          #3

          Hi @SGaist,

          Thank you for your hospitality.

          Here what I tried:

          cmake_minimum_required(VERSION 3.26)
          set(CMAKE_CXX_STANDARD 20)
          set(CMAKE_CXX_STANDARD_REQUIRED ON)
          set(LLVM_ENABLE_LIBCXX ON)
          set(CMAKE_INCLUDE_CURRENT_DIR ON)
          
          set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
          set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
          set(CXX_SCAN_FOR_MODULES ON)
          
          SGaistS 1 Reply Last reply
          0
          • D devloop

            Hi @SGaist,

            Thank you for your hospitality.

            Here what I tried:

            cmake_minimum_required(VERSION 3.26)
            set(CMAKE_CXX_STANDARD 20)
            set(CMAKE_CXX_STANDARD_REQUIRED ON)
            set(LLVM_ENABLE_LIBCXX ON)
            set(CMAKE_INCLUDE_CURRENT_DIR ON)
            
            set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP 1)
            set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API "aa1f7df0-828a-4fcd-9afc-2dc80491aca7")
            set(CXX_SCAN_FOR_MODULES ON)
            
            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #4

            Do you mean that with that configuration, it works in the terminal ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • D Offline
              D Offline
              devloop
              wrote on last edited by
              #5

              @SGaist

              Knowing that the CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API have to be changed, according to some setup, etc., yes, I can build, from a terminal, with this kind of configuration, for instance with a command like cmake -GNinja ..

              But it does not work with Qt Creator.

              Indeed, as soon as I add any line related to modules, like module; I get an error from Qt Creator: Could not build module 'std'.

              98f1337b-ec3d-4834-ac13-a5a5e0c58a74-image.png

              O 1 Reply Last reply
              0
              • D devloop

                @SGaist

                Knowing that the CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API have to be changed, according to some setup, etc., yes, I can build, from a terminal, with this kind of configuration, for instance with a command like cmake -GNinja ..

                But it does not work with Qt Creator.

                Indeed, as soon as I add any line related to modules, like module; I get an error from Qt Creator: Could not build module 'std'.

                98f1337b-ec3d-4834-ac13-a5a5e0c58a74-image.png

                O Offline
                O Offline
                odelaune
                wrote on last edited by
                #6

                @devloop said in QtCreator 10 and C++20 modules:

                module

                It is probably related to QTCREATORBUG-28465.

                D 1 Reply Last reply
                0
                • O odelaune

                  @devloop said in QtCreator 10 and C++20 modules:

                  module

                  It is probably related to QTCREATORBUG-28465.

                  D Offline
                  D Offline
                  devloop
                  wrote on last edited by
                  #7

                  @odelaune

                  Thanks, but why writing this :

                  This is the only thing that clangd doesn't do automatically and thats why it shows false-positives errors in current QtCreator (based on outdated BMI).

                  While it is more than false-positives errors, as it does not even compile from Qt Creator?

                  1 Reply Last reply
                  0
                  • D devloop has marked this topic as solved on
                  • D Offline
                    D Offline
                    devloop
                    wrote on last edited by devloop
                    #8

                    @odelaune

                    After cleaning all build files, etc., it appears that you were right.

                    Unfortunately, even Qt Creator 11 does not address the issue…

                    1 Reply Last reply
                    0
                    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on

                    • Login

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