[Interest] Qt6 on Ubuntu 22
Nuno Santos
nuno.santos at imaginando.pt
Thu Dec 29 15:31:15 CET 2022
Hi,
Thanks you both for your replies. It worked.
I also had to install libgl1-mesa-dev otherwise QtGui couldn’t be found.
I have an another problem though. A simple qt quick project does not compile with the following error:
11:30:34: Running steps for project qt6-test...
11:30:34: Starting: "/usr/bin/cmake" --build /home/nsantos/workspace/build-qt6-test-Desktop-Debug --target clean
11:30:34: The process "/usr/bin/cmake" exited normally.
11:30:34: Starting: "/usr/bin/cmake" --build /home/nsantos/workspace/build-qt6-test-Desktop-Debug --target all
[ 5%] Generating qt6-test/main.qml
[ 5%] Built target appqt6-test_tooling
[ 11%] Generating .rcc/qmlcache/appqt6-test_qmlcache_loader.cpp
[ 16%] Automatic MOC for target appqt6-test
[ 16%] Built target appqt6-test_autogen
[ 22%] Running AUTOMOC file extraction for target appqt6-test
[ 22%] Built target appqt6-test_automoc_json_extraction
[ 27%] Running moc --collect-json for target appqt6-test
[ 33%] Automatic QML type registration for target appqt6-test
[ 38%] Generating .rcc/qmlcache/appqt6-test_main_qml.cpp
[ 44%] Running rcc for resource appqt6-test_raw_qml_0
[ 50%] Running rcc for resource qmake_qt6-test
[ 55%] Building CXX object CMakeFiles/appqt6-test.dir/appqt6-test_autogen/mocs_compilation.cpp.o
[ 61%] Building CXX object CMakeFiles/appqt6-test.dir/main.cpp.o
[ 66%] Building CXX object CMakeFiles/appqt6-test.dir/appqt6-test_qmltyperegistrations.cpp.o
/home/nsantos/workspace/build-qt6-test-Desktop-Debug/appqt6-test_qmltyperegistrations.cpp:17:23: error: variable has incomplete type 'void'
Q_QMLTYPE_EXPORT void qml_register_types_qt6-test()
^
/home/nsantos/workspace/build-qt6-test-Desktop-Debug/appqt6-test_qmltyperegistrations.cpp:17:45: error: expected ';' after top level declarator
Q_QMLTYPE_EXPORT void qml_register_types_qt6-test()
^
;
2 errors generated.
gmake[2]: *** [CMakeFiles/appqt6-test.dir/build.make:160: CMakeFiles/appqt6-test.dir/appqt6-test_qmltyperegistrations.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:94: CMakeFiles/appqt6-test.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
11:30:40: The process "/usr/bin/cmake" exited with code 2.
Error while building/deploying project qt6-test (kit: Desktop)
When executing step "Build"
11:30:40: Elapsed time: 00:05.
Has anyone know the reason?
Thanks!
Regards,
Nuno
> On 29 Dec 2022, at 12:31, A. Pönitz <apoenitz at t-online.de> wrote:
>
> On Thu, Dec 29, 2022 at 10:44:57AM +0000, Nuno Santos wrote:
>> Hi,
>>
>> I’m trying to install and run Qt projects on Linux Ubuntu 22
>>
>> I’ve used apt to install qt6-base-dev, qtcreator and libqt6quick6 packages.
>>
>> But when I run Qt Creator and try a test project it always fails to find QtQuick packages:
>>
>> Running /usr/bin/cmake -S /home/nsantos/workspace/qt6-test -B /home/nsantos/workspace/build-qt6-test-Desktop-Debug in /home/nsantos/workspace/build-qt6-test-Desktop-Debug.
>> -- Could NOT find Qt6Quick (missing: Qt6Quick_DIR)
>> CMake Error at CMakeLists.txt:8 (find_package):
>> Found package configuration file: /usr/lib/x86_64-linux-gnu/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT
>> FOUND. Reason given by package: Failed to find Qt component "Quick". Expected Config file at
>> "/usr/lib/x86_64-linux-gnu/cmake/Qt6Quick/Qt6QuickConfig.cmake" does NOT
>> exist-- Configuring incomplete, errors occurred!
>> See also "/home/nsantos/workspace/build-qt6-test-Desktop-Debug/CMakeFiles/CMakeOutput.log".
>> CMake process exited with exit code 1.
>>
>> The directory /usr/lib/x86_64-linux-gnu/cmake/Qt6Quick is actually missing, so what package should I need to install in order to have it?
>
> Juudging from apt output I'd try qt6-declarative-dev and perhaps
> qt6-declarative-dev-tools
>
> $ apt-cache search qt6- | grep dev
> qcoro-qt6-dev - C++20 coroutines for Qt6 - development
> qt6-3d-dev - Qt 6 3D - development files
> qt6-base-dev - Qt 6 base development files
> qt6-base-dev-tools - Qt 6 base development programs
> qt6-base-private-dev - Qt 6 base private development files
> qt6-connectivity-dev - Qt 6 Connectivity - development files
> qt6-declarative-dev - Qt 6 declarative development files
> qt6-declarative-dev-tools - Qt 6 declarative development programs
> qt6-declarative-private-dev - Qt 6 declarative private development files
> qt6-multimedia-dev - Qt 6 Multimedia - development files
> qt6-pdf-dev - Qt 6 PDF library - development files
> qt6-positioning-dev - Qt 6 Positioning - development files
> qt6-quick3d-dev - Qt 6 Quick 3D - development files
> qt6-quick3d-dev-tools - Qt 6 Quick 3D development programs
> qt6-remoteobjects-dev - Qt 6 Remote Objects - development files
> qt6-scxml-dev - Qt 6 SCXML - development files
> qt6-tools-dev - Qt 6 Tools - development files
> qt6-tools-dev-tools - Qt 6 development tools
> qt6-tools-private-dev - Qt 6 Tools - private development files
> qt6-wayland-dev - Qt 6 Wayland - development files
> qt6-wayland-dev-tools - Qt 6 Wayland developer tools
> qt6-webengine-dev - Qt 6 WebEngine library - development files
> qt6-webengine-dev-tools - Qt 6 WebEngine development programs
> qt6-webengine-private-dev - Qt 6 WebEngine library - private development files
> qt6-webview-dev - Qt 6 WebView - development files
> qtkeychain-qt6-dev - Development files for qtkeychain (QT6 version)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20221229/e6d6bdb2/attachment.htm>
More information about the Interest
mailing list