sofa-framework / sofa

Real-time multi-physics simulation with an emphasis on medical simulation.
https://www.sofa-framework.org
GNU Lesser General Public License v2.1
929 stars 312 forks source link

Build from source error libQt5Core.so.5.15.2: undefined reference to #3829

Open SantiDiazC opened 1 year ago

SantiDiazC commented 1 year ago

Hi, I tried to build SOFA from source following the instructions on the website and the youtube video (Linux compilation), however, it crashes at the end with the following error:

[100%] Built target SceneChecking_test [100%] Linking CXX executable ../../../bin/runSofa /usr/bin/ld: /home/hri/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to ''std::exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13' /usr/bin/ld: /home/hri/anaconda3/lib/libQt5Widgets.so.5.15.2: undefined reference to 'std::__throw_bad_array_new_length()@GLIBCXX_3.4.29' /usr/bin/ld: /home/hri/anaconda3/lib/libQt5Core.so.5.15.2: undefined reference to `std::exception_ptr::exception_ptr::_M_addref()@CXXABI_1.3.13' clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: [applications/projects/runSofa/CMakeFiles/runSofa.dir/build.make:159: bin/runSofa-22.12.00] Error 1 make[1]: [CMakeFiles/Makefile2:18991: applications/projects/runSofa/CMakeFiles/runSofa.dir/all] Error 2 make: *** [Makefile:152: all] Error 2

Selection_003

I added the CMAKE_PREFIX_PATH as suggested in the Troubleshooting CMake errors section, and the CMAKE configuration looks like the image attached.

Does anyone know how to solve this problem? Thank you in advance!

fredroy commented 1 year ago

The Qt you downloaded (and you set in CMAKE_PREFIX_PATH) is not the same as the ones detected by CMake. CMake auto-detected the one you downloaded through anaconda through other packages. So I suppose the compiler is using the headers of the Qt in /home/hri/Qt and the linker is using the libs in /home/hri/anaconda, hence the symbols error about glibc.

2 choices: