Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Does Qt6 require CLANG to build? What if GCC ONLY?
Forum Updated to NodeBB v4.3 + New Features

Does Qt6 require CLANG to build? What if GCC ONLY?

Scheduled Pinned Locked Moved Unsolved Qt 6
7 Posts 6 Posters 1.4k 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.
  • J Offline
    J Offline
    jiapei1000
    wrote on 2 Dec 2022, 19:38 last edited by
    #1
    1. Does Qt6 require CLANG to build? What if GCC ONLY?
    2. I actually installed CLANG already.
    ➜  build clang --version
    clang version 16.0.0 (https://github.com/llvm/llvm-project.git 26fa17ed2914bd80c066d36b325fd3104e45554c)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /usr/local/bin
    

    So, what else did I miss to build Qt6 from source ???

    [ 72%] Linking CXX executable ../../../../qtbase/bin/lupdate
    cd ....../qt-everywhere-src-6.4.1/build/qttools/src/linguist/lupdate && /usr/local/bin/cmake -E cmake_link_script CMakeFiles/lupdate.dir/link.txt --verbose=1
    /usr/bin/c++ -DNDEBUG -O2 -Wl,--enable-new-dtags CMakeFiles/lupdate.dir/lupdate_autogen/mocs_compilation.cpp.o CMakeFiles/lupdate.dir/__/shared/numerus.cpp.o CMakeFiles/lupdate.dir/__/shared/po.cpp.o CMakeFiles/lupdate.dir/__/shared/projectdescriptionreader.cpp.o CMakeFiles/lupdate.dir/__/shared/qm.cpp.o CMakeFiles/lupdate.dir/__/shared/qph.cpp.o CMakeFiles/lupdate.dir/__/shared/qrcreader.cpp.o CMakeFiles/lupdate.dir/__/shared/runqttool.cpp.o CMakeFiles/lupdate.dir/__/shared/simtexth.cpp.o CMakeFiles/lupdate.dir/__/shared/translator.cpp.o CMakeFiles/lupdate.dir/__/shared/translatormessage.cpp.o CMakeFiles/lupdate.dir/__/shared/ts.cpp.o CMakeFiles/lupdate.dir/__/shared/xliff.cpp.o CMakeFiles/lupdate.dir/__/shared/xmlparser.cpp.o CMakeFiles/lupdate.dir/cpp.cpp.o CMakeFiles/lupdate.dir/java.cpp.o CMakeFiles/lupdate.dir/python.cpp.o CMakeFiles/lupdate.dir/main.cpp.o CMakeFiles/lupdate.dir/merge.cpp.o CMakeFiles/lupdate.dir/ui.cpp.o CMakeFiles/lupdate.dir/qdeclarative.cpp.o CMakeFiles/lupdate.dir/clangtoolastreader.cpp.o CMakeFiles/lupdate.dir/cpp_clang.cpp.o CMakeFiles/lupdate.dir/filesignificancecheck.cpp.o CMakeFiles/lupdate.dir/lupdatepreprocessoraction.cpp.o -o ../../../../qtbase/bin/lupdate  -Wl,-rpath,....../qt-everywhere-src-6.4.1/build/qtbase/lib:/usr/local/lib: ../../../../qtbase/lib/libQt6Qml.so.6.4.1 ../../../../qtbase/lib/libQt6Network.so.6.4.1 ../../../../qtbase/lib/libQt6Core.so.6.4.1 /usr/local/lib/libclang.so.16.0.0git /usr/local/lib/libclangHandleCXX.so.16git -Wl,-rpath-link,/usr/local/lib 
    /usr/bin/ld: CMakeFiles/lupdate.dir/cpp_clang.cpp.o: in function `ClangCppParser::loadCPP(Translator&, QList<QString> const&, ConversionData&, bool*)::{lambda()#2}::operator()() const':
    cpp_clang.cpp:(.text+0x581): undefined reference to `llvm::vfs::getRealFileSystem()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x5b2): undefined reference to `clang::PCHContainerOperations::PCHContainerOperations()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x5ea): undefined reference to `clang::tooling::ClangTool::ClangTool(clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::shared_ptr<clang::PCHContainerOperations>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::IntrusiveRefCntPtr<clang::FileManager>)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x6a0): undefined reference to `clang::tooling::ClangTool::appendArgumentsAdjuster(std::function<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, llvm::StringRef)>)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x6de): undefined reference to `clang::tooling::ClangTool::run(clang::tooling::ToolAction*)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x6e6): undefined reference to `clang::tooling::ClangTool::~ClangTool()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x72c): undefined reference to `clang::FileManager::~FileManager()'
    /usr/bin/ld: CMakeFiles/lupdate.dir/cpp_clang.cpp.o: in function `ClangCppParser::loadCPP(Translator&, QList<QString> const&, ConversionData&, bool*)::{lambda()#1}::operator()() const':
    cpp_clang.cpp:(.text+0x871): undefined reference to `llvm::vfs::getRealFileSystem()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x8a2): undefined reference to `clang::PCHContainerOperations::PCHContainerOperations()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x8da): undefined reference to `clang::tooling::ClangTool::ClangTool(clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::shared_ptr<clang::PCHContainerOperations>, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, llvm::IntrusiveRefCntPtr<clang::FileManager>)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x990): undefined reference to `clang::tooling::ClangTool::appendArgumentsAdjuster(std::function<std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, llvm::StringRef)>)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x9ce): undefined reference to `clang::tooling::ClangTool::run(clang::tooling::ToolAction*)'
    /usr/bin/ld: cpp_clang.cpp:(.text+0x9d6): undefined reference to `clang::tooling::ClangTool::~ClangTool()'
    /usr/bin/ld: cpp_clang.cpp:(.text+0xa1c): undefined reference to `clang::FileManager::~FileManager()'
    

    Thank you very much....

    A nobody in computer vision & AI

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JoeCFD
      wrote on 2 Dec 2022, 19:49 last edited by
      #2

      On Linux gcc/g++ are good enough. I do not use clang on Linux.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 2 Dec 2022, 19:49 last edited by
        #3

        Hi,

        1. no it does not. Only some of the tools needs clang but these are optional.
        2. I currently don't know why but isn't clang's current stable release 15 ?

        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
        • T Offline
          T Offline
          TomZ
          wrote on 2 Dec 2022, 20:47 last edited by
          #4

          @SGaist said in Does Qt6 require CLANG to build? What if GCC ONLY?:

          I currently don't know why but isn't clang's current stable release 15 ?

          There is indeed no release available that could give the output the user pasted.

          Conclusion, they are running a git or similarly unstable release of LLVM.

          T 1 Reply Last reply 19 Nov 2023, 13:14
          0
          • T TomZ
            2 Dec 2022, 20:47

            @SGaist said in Does Qt6 require CLANG to build? What if GCC ONLY?:

            I currently don't know why but isn't clang's current stable release 15 ?

            There is indeed no release available that could give the output the user pasted.

            Conclusion, they are running a git or similarly unstable release of LLVM.

            T Offline
            T Offline
            taekahn
            wrote on 19 Nov 2023, 13:14 last edited by
            #5

            I ran into the same issue (and i have noticed many others have as well), and while i'm using the same version of clang, clang 16 is long since stable since clang is currently on 17 as of this post.

            To be specific, the issue i ran into was trying to build qt using gcc, and i had the exact same linking issue on the exact same target, lupdate.

            Also i feel its worth pointing that the version of clang the person posted here was irrelevant to the discussion since they stated they were trying to build with gcc.

            I ultimately decided to build it with clang instead of gcc, and it built fine.
            So for anyone who stumbles upon this page with the same issue, just use clang, i guess, because linking in gcc , at least on a system with clang 16, is somehow screwed up.

            J 1 Reply Last reply 29 Nov 2023, 00:38
            0
            • T taekahn
              19 Nov 2023, 13:14

              I ran into the same issue (and i have noticed many others have as well), and while i'm using the same version of clang, clang 16 is long since stable since clang is currently on 17 as of this post.

              To be specific, the issue i ran into was trying to build qt using gcc, and i had the exact same linking issue on the exact same target, lupdate.

              Also i feel its worth pointing that the version of clang the person posted here was irrelevant to the discussion since they stated they were trying to build with gcc.

              I ultimately decided to build it with clang instead of gcc, and it built fine.
              So for anyone who stumbles upon this page with the same issue, just use clang, i guess, because linking in gcc , at least on a system with clang 16, is somehow screwed up.

              J Offline
              J Offline
              jiapei1000
              wrote on 29 Nov 2023, 00:38 last edited by
              #6

              @taekahn As for today, I'm trying to build Qt6-6.6.1 with CLANG-18.0.0git, however, I got the following error messages:

              [ 34%] Built target HttpServer
              In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:56:15: error: use of undeclared identifier 'CallOpSendInitialMetadata'
                 56 |     CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
                    |               ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:57:74: error: expected unqualified-id
                 57 |               CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
                    |                                                                          ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:60:15: error: use of undeclared identifier 'ops'
                 60 |     status_ = ops.SendMessagePtr(&request);
                    |               ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:64:5: error: use of undeclared identifier 'ops'
                 64 |     ops.SendInitialMetadata(&context->send_initial_metadata_,
                    |     ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:64:37: error: member access into incomplete type 'grpc_impl::ClientContext'
                 64 |     ops.SendInitialMetadata(&context->send_initial_metadata_,
                    |                                     ^
              /usr/include/grpcpp/impl/codegen/channel_interface.h:28:7: note: forward declaration of 'grpc_impl::ClientContext'
                 28 | class ClientContext;
                    |       ^
              In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:65:36: error: member access into incomplete type 'grpc_impl::ClientContext'
                 65 |                             context->initial_metadata_flags());
                    |                                    ^
              /usr/include/grpcpp/impl/codegen/channel_interface.h:28:7: note: forward declaration of 'grpc_impl::ClientContext'
                 28 | class ClientContext;
                    |       ^
              In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:66:5: error: use of undeclared identifier 'ops'
                 66 |     ops.RecvInitialMetadata(context);
                    |     ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:67:5: error: use of undeclared identifier 'ops'
                 67 |     ops.RecvMessage(result);
                    |     ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:68:5: error: use of undeclared identifier 'ops'
                 68 |     ops.AllowNoMessage();
                    |     ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:69:5: error: use of undeclared identifier 'ops'
                 69 |     ops.ClientSendClose();
                    |     ^
              make[2]: Leaving directory '/opt/qt/qt-everywhere-src-6.6.1/build'
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:70:5: error: use of undeclared identifier 'ops'
                 70 |     ops.ClientRecvStatus(context, &status_);
                    |     ^
              make  -f qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build.make qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:71:22: error: use of undeclared identifier 'ops'
                 71 |     call.PerformOps(&ops);
                    |                      ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:72:15: error: use of undeclared identifier 'ops'
                 72 |     cq.Pluck(&ops);
                    |               ^
              /usr/include/grpcpp/impl/codegen/client_unary_call.h:80:10: error: use of undeclared identifier 'ops'
                 80 |     if (!ops.got_message && status_.ok()) {
                    |          ^
              make[2]: Entering directory '/opt/qt/qt-everywhere-src-6.6.1/build'
              make[2]: Nothing to be done for 'qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build'.
              make[2]: Leaving directory '/opt/qt/qt-everywhere-src-6.6.1/build'
              [ 35%] Built target OpcUa
              

              A nobody in computer vision & AI

              semlanikS 1 Reply Last reply 4 Jan 2024, 06:09
              0
              • J jiapei1000
                29 Nov 2023, 00:38

                @taekahn As for today, I'm trying to build Qt6-6.6.1 with CLANG-18.0.0git, however, I got the following error messages:

                [ 34%] Built target HttpServer
                In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:56:15: error: use of undeclared identifier 'CallOpSendInitialMetadata'
                   56 |     CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage,
                      |               ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:57:74: error: expected unqualified-id
                   57 |               CallOpRecvInitialMetadata, CallOpRecvMessage<OutputMessage>,
                      |                                                                          ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:60:15: error: use of undeclared identifier 'ops'
                   60 |     status_ = ops.SendMessagePtr(&request);
                      |               ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:64:5: error: use of undeclared identifier 'ops'
                   64 |     ops.SendInitialMetadata(&context->send_initial_metadata_,
                      |     ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:64:37: error: member access into incomplete type 'grpc_impl::ClientContext'
                   64 |     ops.SendInitialMetadata(&context->send_initial_metadata_,
                      |                                     ^
                /usr/include/grpcpp/impl/codegen/channel_interface.h:28:7: note: forward declaration of 'grpc_impl::ClientContext'
                   28 | class ClientContext;
                      |       ^
                In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:65:36: error: member access into incomplete type 'grpc_impl::ClientContext'
                   65 |                             context->initial_metadata_flags());
                      |                                    ^
                /usr/include/grpcpp/impl/codegen/channel_interface.h:28:7: note: forward declaration of 'grpc_impl::ClientContext'
                   28 | class ClientContext;
                      |       ^
                In file included from /opt/qt/qt-everywhere-src-6.6.1/qtgrpc/src/grpc/qgrpcchannel.cpp:17:
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:66:5: error: use of undeclared identifier 'ops'
                   66 |     ops.RecvInitialMetadata(context);
                      |     ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:67:5: error: use of undeclared identifier 'ops'
                   67 |     ops.RecvMessage(result);
                      |     ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:68:5: error: use of undeclared identifier 'ops'
                   68 |     ops.AllowNoMessage();
                      |     ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:69:5: error: use of undeclared identifier 'ops'
                   69 |     ops.ClientSendClose();
                      |     ^
                make[2]: Leaving directory '/opt/qt/qt-everywhere-src-6.6.1/build'
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:70:5: error: use of undeclared identifier 'ops'
                   70 |     ops.ClientRecvStatus(context, &status_);
                      |     ^
                make  -f qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build.make qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:71:22: error: use of undeclared identifier 'ops'
                   71 |     call.PerformOps(&ops);
                      |                      ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:72:15: error: use of undeclared identifier 'ops'
                   72 |     cq.Pluck(&ops);
                      |               ^
                /usr/include/grpcpp/impl/codegen/client_unary_call.h:80:10: error: use of undeclared identifier 'ops'
                   80 |     if (!ops.got_message && status_.ok()) {
                      |          ^
                make[2]: Entering directory '/opt/qt/qt-everywhere-src-6.6.1/build'
                make[2]: Nothing to be done for 'qtopcua/src/opcua/CMakeFiles/OpcUa.dir/build'.
                make[2]: Leaving directory '/opt/qt/qt-everywhere-src-6.6.1/build'
                [ 35%] Built target OpcUa
                
                semlanikS Offline
                semlanikS Offline
                semlanik
                wrote on 4 Jan 2024, 06:09 last edited by semlanik 1 Apr 2024, 06:10
                #7

                @jiapei1000 please set -no-feature-native_grpc or -DFEATURE_native_grpc=OFF when configuring Qt/QtGRPC. This will unblock your build.

                1 Reply Last reply
                0

                • Login

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