Qt 6 on Linux linker error "adding symbols: DSO missing from command line"
-
wrote on 23 May 2021, 17:15 last edited by JohnGa
Hello,
I installed Qt 6 on Linux. In all my projects I get this error during linking. Shown below is an example of a simple new Qt application with a form. This project is using cmakeSearching the web, I saw a suggestion to add "-lstdc++" to the command line. Since Qt has always worked without me having to do this, I wanted to ask the question here.
Can I get a hint on how to resolve this please? I have no idea what this error means.
Thanks
[100%] Linking CXX executable delete-this /usr/bin/ld: CMakeFiles/delete-this.dir/mainwindow.cpp.o: undefined reference to symbol '_ZSt9terminatev@@GLIBCXX_3.4' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line clang-10: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [CMakeFiles/delete-this.dir/build.make:138: delete-this] Error 1 make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/delete-this.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 12:39:02: The process "/Qt/Tools/CMake/bin/cmake" exited with code 2. Error while building/deploying project delete-this (kit: Desktop Qt 6.0.4 GCC 64bit) When executing step "CMake Build
-
Hello,
I installed Qt 6 on Linux. In all my projects I get this error during linking. Shown below is an example of a simple new Qt application with a form. This project is using cmakeSearching the web, I saw a suggestion to add "-lstdc++" to the command line. Since Qt has always worked without me having to do this, I wanted to ask the question here.
Can I get a hint on how to resolve this please? I have no idea what this error means.
Thanks
[100%] Linking CXX executable delete-this /usr/bin/ld: CMakeFiles/delete-this.dir/mainwindow.cpp.o: undefined reference to symbol '_ZSt9terminatev@@GLIBCXX_3.4' /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line clang-10: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [CMakeFiles/delete-this.dir/build.make:138: delete-this] Error 1 make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/delete-this.dir/all] Error 2 make: *** [Makefile:103: all] Error 2 12:39:02: The process "/Qt/Tools/CMake/bin/cmake" exited with code 2. Error while building/deploying project delete-this (kit: Desktop Qt 6.0.4 GCC 64bit) When executing step "CMake Build
wrote on 23 May 2021, 17:48 last edited by PsnarfCreate a new project with form, build/run - you should see a blank form with no modifications to the code or project.pro. I don't understand the line beginning with 'clang-10'. Check Tools|Options|Kits - make sure the Compiler entries for C and C++ are set to GCC(C...) GCC(C++...). You might have the C++ compiler set to 'clang' instead of GCC.
-
Create a new project with form, build/run - you should see a blank form with no modifications to the code or project.pro. I don't understand the line beginning with 'clang-10'. Check Tools|Options|Kits - make sure the Compiler entries for C and C++ are set to GCC(C...) GCC(C++...). You might have the C++ compiler set to 'clang' instead of GCC.
wrote on 23 May 2021, 18:47 last edited by@Psnarf, Thanks for the tip.
On a hunch, instead of using the auto-detected Qt6, I manually created a new kit. This resolved the issue.I looked at both the auto-detected and the manually created kit, but could NOT spot any differences.
3/3