Qt build crashes
Unsolved
Qt 6
-
When i try to build QT 6.3.1 on ubuntu it crashes at 40%
Generating version linker script /usr/bin/ld: CMakeFiles/Qml.dir/jsruntime/qv4engine.cpp.o: in function `QV4::ExecutionEngine::catchExceptionAsQmlError()': qv4engine.cpp:(.text+0x40e4): undefined reference to `QQmlError::QQmlError()' /usr/bin/ld: qv4engine.cpp:(.text+0x413d): undefined reference to `QQmlError::setDescription(QString const&)' /usr/bin/ld: qv4engine.cpp:(.text+0x42b8): undefined reference to `QQmlError::setUrl(QUrl const&)' /usr/bin/ld: qv4engine.cpp:(.text+0x42cc): undefined reference to `QQmlError::setLine(int)' /usr/bin/ld: qv4engine.cpp:(.text+0x42d8): undefined reference to `QQmlError::setColumn(int)' /usr/bin/ld: CMakeFiles/Qml.dir/jsruntime/qv4qmlcontext.cpp.o: in function `QQmlTypeNameCache::Result QQmlTypeNameCache::doQuery<QV4::String const*, (QQmlImport::RecursionRestriction)1>(QV4::String const*) const': ... /usr/bin/ld: CMakeFiles/Qml.dir/qml/qqmlscriptdata.cpp.o: in function `QQmlScriptData::scriptValueForContext(QQmlRefPointer<QQmlContextData> const&) [clone .part.0]': qqmlscriptdata.cpp:(.text+0x794): undefined reference to `QQmlError::isValid() const' /usr/bin/ld: qqmlscriptdata.cpp:(.text+0x7b8): undefined reference to `QQmlError::~QQmlError()' /usr/bin/ld: CMakeFiles/Qml.dir/qml/qqmltypeloaderqmldircontent.cpp.o: in function `QQmlTypeLoaderQmldirContent::setError(QQmlError const&)': qqmltypeloaderqmldircontent.cpp:(.text+0x9a): undefined reference to `QQmlError::line() const' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0xa6): undefined reference to `QQmlError::column() const' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0xb5): undefined reference to `QQmlError::description() const' /usr/bin/ld: CMakeFiles/Qml.dir/qml/qqmltypeloaderqmldircontent.cpp.o: in function `QQmlTypeLoaderQmldirContent::errors(QString const&) const': qqmltypeloaderqmldircontent.cpp:(.text+0x1f4): undefined reference to `QQmlError::QQmlError()' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0x1ff): undefined reference to `QQmlError::setUrl(QUrl const&)' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0x212): undefined reference to `QQmlError::setLine(int)' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0x225): undefined reference to `QQmlError::setColumn(int)' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0x230): undefined reference to `QQmlError::setDescription(QString const&)' /usr/bin/ld: qqmltypeloaderqmldircontent.cpp:(.text+0x26a): undefined reference to `QQmlError::~QQmlError()' collect2: error: ld returned 1 exit status gmake[2]: *** [qtdeclarative/src/qml/CMakeFiles/Qml.dir/build.make:4064: qtbase/lib/libQt6Qml.so.6.3.1] Error 1 gmake[1]: *** [CMakeFiles/Makefile2:22454: qtdeclarative/src/qml/CMakeFiles/Qml.dir/all] Error 2 gmake: *** [Makefile:146: all] Error 2
-
This post is deleted!
-
Add below line in your CMakeLists.txt file :
find_package(Qt6 REQUIRED COMPONENTS Qml)
target_link_libraries(${myProject} PRIVATE Qt6::Qml)