Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Build Qt fails - can't locate libclang
Forum Updated to NodeBB v4.3 + New Features

Build Qt fails - can't locate libclang

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 4 Posters 3.0k Views
  • 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.
  • K Offline
    K Offline
    KeithS
    wrote on last edited by
    #1

    Trying to build Qt6.4.3 from source. I have followed the docs and installed Perl, Python, Cmake, Ninja, Node.js, OpenSSL and LLVM.

    LLVM version 16 was installed at C:\Program Files\LLVM and the env var LLVM_INSTALL_DIR set to this directory. Also LLVM_INSTALL_DIR\bin was added to the PATH, and I have checked that clang.exe is found.

    The configure script is then

    configure -prefix C:\Qt\6.4.3-x64 -confirm-license -commercial -debug-and-release -mp -opengl desktop -openssl-runtime OPENSSL_INCDIR="C:\Program Files\OpenSSL-Win64\include" -mp -nomake tests -nomake examples

    This all runs and has no errors apart from the final woraning "WARNING: QDoc will not be compiled, probably because libclang could not be located. "

    So I'm baffled as to what is wrong/missing. Anyone else built Qt6 from source successfully?

    • Keith
    jsulmJ 1 Reply Last reply
    0
    • K KeithS

      Trying to build Qt6.4.3 from source. I have followed the docs and installed Perl, Python, Cmake, Ninja, Node.js, OpenSSL and LLVM.

      LLVM version 16 was installed at C:\Program Files\LLVM and the env var LLVM_INSTALL_DIR set to this directory. Also LLVM_INSTALL_DIR\bin was added to the PATH, and I have checked that clang.exe is found.

      The configure script is then

      configure -prefix C:\Qt\6.4.3-x64 -confirm-license -commercial -debug-and-release -mp -opengl desktop -openssl-runtime OPENSSL_INCDIR="C:\Program Files\OpenSSL-Win64\include" -mp -nomake tests -nomake examples

      This all runs and has no errors apart from the final woraning "WARNING: QDoc will not be compiled, probably because libclang could not be located. "

      So I'm baffled as to what is wrong/missing. Anyone else built Qt6 from source successfully?

      • Keith
      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @KeithS Do you have libclang? Check the config.log file to get more information about the issue.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      0
      • jsulmJ jsulm

        @KeithS Do you have libclang? Check the config.log file to get more information about the issue.

        K Offline
        K Offline
        KeithS
        wrote on last edited by
        #3

        @jsulm There is a libclang.lib:

        C:\Program Files\LLVM\lib>ll
        total 1085
        -rw-rw-rw- 1 user group 135462 Mar 19 22:43 libomp.lib
        -rw-rw-rw- 1 user group 15782 Mar 19 22:44 LTO.lib
        -rw-rw-rw- 1 user group 78492 Mar 19 22:47 libclang.lib
        -rw-rw-rw- 1 user group 5654 Mar 19 22:48 Remarks.lib
        -rw-rw-rw- 1 user group 229258 Mar 19 22:48 LLVM-C.lib
        -rw-rw-rw- 1 user group 643268 Mar 19 22:48 liblldb.lib
        drwxrwxrwx 1 user group 0 Mar 30 12:00 clang
        drwxrwxrwx 1 user group 0 Mar 30 12:00 libear
        drwxrwxrwx 1 user group 0 Mar 30 12:00 cmake
        drwxrwxrwx 1 user group 0 Mar 30 12:00 site-packages
        drwxrwxrwx 1 user group 0 Mar 30 12:00 libscanbuild

        There does not seem to be any config.log in the installation directory?

        jsulmJ 1 Reply Last reply
        0
        • K KeithS

          @jsulm There is a libclang.lib:

          C:\Program Files\LLVM\lib>ll
          total 1085
          -rw-rw-rw- 1 user group 135462 Mar 19 22:43 libomp.lib
          -rw-rw-rw- 1 user group 15782 Mar 19 22:44 LTO.lib
          -rw-rw-rw- 1 user group 78492 Mar 19 22:47 libclang.lib
          -rw-rw-rw- 1 user group 5654 Mar 19 22:48 Remarks.lib
          -rw-rw-rw- 1 user group 229258 Mar 19 22:48 LLVM-C.lib
          -rw-rw-rw- 1 user group 643268 Mar 19 22:48 liblldb.lib
          drwxrwxrwx 1 user group 0 Mar 30 12:00 clang
          drwxrwxrwx 1 user group 0 Mar 30 12:00 libear
          drwxrwxrwx 1 user group 0 Mar 30 12:00 cmake
          drwxrwxrwx 1 user group 0 Mar 30 12:00 site-packages
          drwxrwxrwx 1 user group 0 Mar 30 12:00 libscanbuild

          There does not seem to be any config.log in the installation directory?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @KeithS said in Build Qt fails - can't locate libclang:

          There does not seem to be any config.log in the installation directory?

          It is in the folder from which you called configure...

          You also should avoid using folders with spaces.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          K 1 Reply Last reply
          0
          • jsulmJ jsulm

            @KeithS said in Build Qt fails - can't locate libclang:

            There does not seem to be any config.log in the installation directory?

            It is in the folder from which you called configure...

            You also should avoid using folders with spaces.

            K Offline
            K Offline
            KeithS
            wrote on last edited by
            #5

            @jsulm I don't have a directory called configure inthe Qt build directory (there is a file called configure, and a directory called config.tests).

            R.e. directory names with spaces, that's Windows for you - C:\Program Files and C:\Program Files (x86).

            Thing is, it did work in the past for Qt 5.15.x - QDoc would find clang using the same installation. BUt then the Qt folks seem to break things with every new release, sigh.

            jsulmJ 1 Reply Last reply
            0
            • K KeithS

              @jsulm I don't have a directory called configure inthe Qt build directory (there is a file called configure, and a directory called config.tests).

              R.e. directory names with spaces, that's Windows for you - C:\Program Files and C:\Program Files (x86).

              Thing is, it did work in the past for Qt 5.15.x - QDoc would find clang using the same installation. BUt then the Qt folks seem to break things with every new release, sigh.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @KeithS said in Build Qt fails - can't locate libclang:

              I don't have a directory called configure

              I did not write anything about folder called "configure". I'm talking about folder in which you were when you called configure (build folder):

              cd SOME_FOLDER
              configure ...
              

              "that's Windows for you" - doesn't stop you from installing into other folders, just like Qt does...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              K 1 Reply Last reply
              0
              • jsulmJ jsulm

                @KeithS said in Build Qt fails - can't locate libclang:

                I don't have a directory called configure

                I did not write anything about folder called "configure". I'm talking about folder in which you were when you called configure (build folder):

                cd SOME_FOLDER
                configure ...
                

                "that's Windows for you" - doesn't stop you from installing into other folders, just like Qt does...

                K Offline
                K Offline
                KeithS
                wrote on last edited by
                #7

                @jsulm Ah sorry I misunderstood you. The directory that 'configure' was run in does not have a config.log:

                C:\Qt\qt-everywhere-src-6.4.3>ls config*
                config.opt configure configure_windows_64.bat
                config.opt.in configure.bat
                config.summary configure.json

                config.tests=:
                assimp linux_v4l socketcan
                bluez no_direct_extern_access socketcan_fd
                bluez_le precompile_header winrt_bt
                evr qt3d_fbxsdk winrt_geolocation
                gpu_vivante quick3d_assimp winrt_sensors
                linux_crypto_api separate_debug_info wmsdk

                In regard to LLVM, perhaps something in Qt has broken since 5.15 installer and it indeed doesn't like spaces in directory names. OK so I'll try 'C:\PROGRA~1\LLVM' which translates to the same path with long names.

                K 1 Reply Last reply
                0
                • K KeithS

                  @jsulm Ah sorry I misunderstood you. The directory that 'configure' was run in does not have a config.log:

                  C:\Qt\qt-everywhere-src-6.4.3>ls config*
                  config.opt configure configure_windows_64.bat
                  config.opt.in configure.bat
                  config.summary configure.json

                  config.tests=:
                  assimp linux_v4l socketcan
                  bluez no_direct_extern_access socketcan_fd
                  bluez_le precompile_header winrt_bt
                  evr qt3d_fbxsdk winrt_geolocation
                  gpu_vivante quick3d_assimp winrt_sensors
                  linux_crypto_api separate_debug_info wmsdk

                  In regard to LLVM, perhaps something in Qt has broken since 5.15 installer and it indeed doesn't like spaces in directory names. OK so I'll try 'C:\PROGRA~1\LLVM' which translates to the same path with long names.

                  K Offline
                  K Offline
                  KeithS
                  wrote on last edited by
                  #8

                  ...Using short names for the LLVM_INSTALL_DIR gave exactly the same result - clang missing:

                  Configuring submodule 'qttools'
                  -- Could NOT find Clang (missing: Clang_DIR)
                  -- Could NOT find Clang (missing: Clang_DIR)
                  ....
                  WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation.
                  Either set CMAKE_PREFIX_PATH or LLVM_INSTALL_DIR to the location of your llvm installation.
                  On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution.
                  On macOS, you can use Homebrew's llvm package.
                  You will also need to set the FEATURE_clang CMake variable to ON to re-evaluate this check.
                  WARNING: Clang-based lupdate parser will not be available. LLVM and Clang C++ libraries have not been found.
                  You will need to set the FEATURE_clangcpp CMake variable to ON to re-evaluate this check.

                  1 Reply Last reply
                  0
                  • W Offline
                    W Offline
                    wssddc
                    wrote on last edited by
                    #9

                    I know this is an old thread, but I see the same problem building Qt 5.15.10 from source. It works with LLVM 15.06, but can't build QDoc with LLVM 16.06. (Windows 10, 64-bit). I got LLVM binaries from https://github.com/llvm/llvm-project/releases, not from Qt.

                    1 Reply Last reply
                    0
                    • J Offline
                      J Offline
                      Johnson III
                      wrote on last edited by
                      #10

                      Me too. And there is a links :
                      https://bugreports.qt.io/browse/QTBUG-81214

                      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