Build Qt fails - can't locate libclang
-
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
-
@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 libscanbuildThere does not seem to be any config.log in the installation directory?
-
@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.
-
@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.
-
@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...
-
@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.jsonconfig.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 wmsdkIn 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.
-
...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. -
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.
-
Me too. And there is a links :
https://bugreports.qt.io/browse/QTBUG-81214