9/14/2023 0 Comments Cmake windows link static libraryBuilding CXX object CMakeFiles/helloworld.dir/ Building CXX object CMakeFiles/helloworld.dir/helloworld_autogen/mocs_ Building CXX object CMakeFiles/helloworld.dir/qrc_ Scanning dependencies of target helloworld Scanning dependencies of target helloworld_autogen Build files have been written to: /tmp/qt5-static-hello-world-master/build Check for working CXX compiler: /usr/bin/c++ - works Check for working CXX compiler: /usr/bin/c++ Check for working C compiler: /usr/bin/cc - works Check for working C compiler: /usr/bin/cc The CXX compiler identification is GNU 9.3.0 The C compiler identification is GNU 9.3.0 I am able to use a different installation of Qt by invoking cmake as: $ export CMAKE_PREFIX_PATH="/path/to/other/qt/lib/cmake/Qt5" However, I can see (using ldd) that it's dynamically linked to my system's Qt installation. line in DoQtMess.cmake and the Q_IMPORT_PLUGIN(QCocoaIntegrationPlugin) line in main.cpp, it now builds and runs for me in Linux after running cmake without any static-specific arguments. Could it be an explanation that the open source version doesn't support static builds?įirst, note this project but it feels like it was only ever maybe successful on MacOS. The problem might be that I have the open source version of Qt. I'm using Virtual Studio Code (and not Qt Creator).ĭoes anyone have any ideas how to link the static Qt libraries? I'm running Ubuntu on a virtuel machine, and the application is implemented with QML/Qt (5.9). Makefile:129: recipe for target 'all' failed usr/bin/ld: attempted static link of dynamic object `/opt/qt5/lib/libQt5Quick.so.5.9.1'Ĭollect2: error: ld returned 1 exit statusĬMakeFiles/myDemo.dir/build.make:204: recipe for target './bin/myDemo' failedĬMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/myDemo.dir/all' failed The cmake command exits without errors, but the make command exits with the following error message: Project (myDemo VERSION 0.1 LANGUAGES CXX) I've been stuck on this for hours and tried to find any clues on google, but without luck.ĬMakeLists.txt: cmake_minimum_required(VERSION 3.9 FATAL_ERROR) I'm trying to build a Qt5 application with static libraries using CMake, but I can't figure out how to link the files statically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |