libclang-dev 已安装 但是QT 编译 仍然提示 WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation
时间: 2024-03-03 10:53:10 浏览: 177
如果 libclang-dev 已经安装,但是编译仍然提示找不到 libclang,可能是由于 libclang 的头文件或库文件路径没有被正确设置导致的。
你可以尝试在编译 Qt 时手动指定 libclang 的路径。假设 libclang 库文件的路径是 `/usr/lib/x86_64-linux-gnu/libclang.so`,头文件的路径是 `/usr/include/clang/`,则可以使用以下命令进行编译:
```
./configure -opensource -confirm-license -nomake examples -nomake tests -no-opengl -no-openssl -no-xcb -no-xkbcommon -no-icu -no-glib -no-pulseaudio -no-alsa -no-feature-geoservices_mapboxgl -no-feature-geoservices_mapbox -no-feature-geoservices_nokia -no-feature-geoservices_google -no-feature-geoservices_here -no-feature-geoservices_arcgis -no-feature-geoservices_ublox -no-feature-geoservices_maxar -no-feature-textodfwriter -no-feature-xmlpatterns -no-feature-testlib -no-feature-shared -no-feature-process -no-feature-printpreviewwidget -no-feature-printpreviewdialog -no-feature-printenginengeneric -no-feature-printsupport -no-feature-pdf -no-feature-paint_debug -no-feature-network -no-feature-mimetype -no-feature-journald -no-feature-jpeg -no-feature-ibus -no-feature-gif -no-feature-freetype -no-feature-fontconfig -no-feature-dbus -no-feature-cups -no-feature-cursor -no-feature-contextmenu -no-feature-completer -no-feature-commandlineparser -no-feature-codecs -no-feature-colornames -no-feature-colordialog -no-feature-colorpicker -no-feature-clipboard -no-feature-bearermanagement -no-feature-alsa -no-feature-accessibility -no-dbus-linked -no-compile-examples -no-openssl-linked -no-pch -system-zlib -system-libjpeg -system-libpng -system-freetype -system-harfbuzz -system-xcb -system-xkbcommon -no-gui -no-widgets -no-qml-debug -no-qml-debugger -no-compile-examples -no-libudev -no-feature-texthtmlparser -no-feature-textfreetype -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-texthtmlwriter -no-feature-textplaintextwriter -no-feature-textmarkdownreader -no-feature-sql-ibase -no-feature-sql-mysql -no-feature-sql-oci -no-feature-sql-odbc -no-feature-sql-psql -no-feature-sql-sqlite2 -no-feature-sql-sqlite -no-feature-sql-tds -no-feature-sqlite -no-feature-speex -no-feature-sse2 -no-feature-systemsemaphore -no-feature-systemsemaphore -no-feature-syslog -no-feature-tcpserver -no-feature-threads -no-feature-tiff -no-feature-toolbox -no-feature-unix-socket -no-feature-vnc -no-feature-wheelevent -no-feature-wizard -no-feature-xml -no-feature-xmlcatalog -no-feature-xmlstream -no-feature-xml -no-feature-xmlpatterns -no-feature-xmlrpc -no-feature-xcb-icccm -no-feature-xcb-image -no-feature-xcb-keysyms -no-feature-xcb-render -no-feature-xcb-shape -no-feature-xcb-xinput -no-feature-xinput2 -no-feature-xkb -no-feature-xrandr -no-feature-xrender -no-feature-xshm -no-feature-xsync -no-feature-xt -no-feature-ipv6ifname -no-feature-qt3d-logic -no-feature-qt3d-render -no-feature-qt3d-input -no-feature-qt3d-extras -no-feature-qt3d-animation -no-feature-qt3d-quick -no-feature-qt3d-simd -no-feature-qt3d-scene2d -no-feature-qt3d-scene3d -no-feature-qt3d-core -no-feature-qt3d-render -no-feature-qt3d-input -no-feature-qt3d-extras -no-feature-qt3d-animation -no-feature-qt3d-quick -no-feature-qt3d-simd -no-feature-qt3d-scene2d -no-feature-qt3d-scene3d -no-feature-qt3d-core -no-feature-qt3d -no-feature-qtvirtualkeyboard -no-feature-qtwayland -no-feature-qtmultimedia -no-feature-qtpurchasing -no-feature-qtsensors -no-feature-qtspeech -no-feature-qtvirtualkeyboard -no-feature-qtwayland -no-feature-qtmultimedia -no-feature-qtpurchasing -no-feature-qtsensors -no-feature-qtspeech -no-feature-qtwebchannel -no-feature-qtwebengine -no-feature-qtwebsockets -no-feature-qtwebview -no-feature-qtwebglplugin -no-feature-qtwebsockets -no-feature-qtwebview -no-feature-qtwebglplugin -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -no-feature-qtxmlpatterns -no-feature-qtx11extras -no-feature-qtxml -feature-thread
make -j$(nproc) LLVM_INSTALL_DIR=/usr/include/clang/
```
其中,LLVM_INSTALL_DIR 指定了 libclang 的路径,这里设置为 `/usr/include/clang/`,请根据实际情况修改。
阅读全文