build.make:88 上的 clang 链接器错误和对“Unwind_GetIPInfo”的未定义引用

问题描述

在运行 Raspbian buster v10 的 RaspBerry Pi Model 3B 上滚动安装 ROS2 过程

stderr: osrf_testing_tools_cpp
/usr/bin/ld: ../../src/memory_tools/libmemory_tools.so: undefined reference to `_Unwind_GetIPInfo'
clang: error: linker command Failed with exit code 1 (use -v to see invocation)
make[2]: *** [test/memory_tools/CMakeFiles/test_memory_tools.dir/build.make:88: test/memory_tools/test_memory_tools] Error 1
make[1]: *** [CMakeFiles/Makefile2:1255: test/memory_tools/CMakeFiles/test_memory_tools.dir/all] Error 2
make: *** [Makefile:141: all] Error 2


Failed   <<< osrf_testing_tools_cpp [2min 24s,exited with code 2]

我不知道从哪里开始,我可以打开 build.make 文件,第 88 行就说明了这一点。

86 test/memory_tools/test_memory_tools: test/memory_tools/CMakeFiles/test_memory_tools.dir/link.txt
87  @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --green --bold --progress-dir=/home/pi/ros2_rolling/build/osrf_testing_tools_cpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Linking CXX executable test_memory_tools"
88  cd /home/pi/ros2_rolling/build/osrf_testing_tools_cpp/test/memory_tools && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/test_memory_tools.dir/link.txt --verbose=$(VERBOSE)

我认为这个link.txt也很重要。

/usr/bin/clang++     CMakeFiles/test_memory_tools.dir/test_memory_tools.cpp.o  -o test_memory_tools  -Wl,-rpath,/home/pi/ros2_rolling/build/osrf_testing_tools_cpp/src/memory_tools -pthread ../../src/memory_tools/libmemory_tools.so ../../lib/libgtest_main.a /usr/lib/arm-linux-gnueabihf/libdl.so ../../lib/libgtest.a -pthread -lpthread 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)