小白,啥也不懂,本文仅自己修bug记录。
计划复现SFA3D项目:https://github.com/maudzung/SFA3D/tree/ea0222c1b35489dc35d8452c989c4b014e20e0da
参考该文的环境配置:深度学习环境搭建之SFA3D目标检测-CSDN博客
在运行项目前,想要可视化一下KITTI数据集里的bin文件。参考点云学习笔记19——使用pcl将bin文件转化为pcd文件_bin2pcd-CSDN博客 。
$cmake ..成功后,却在$make -j8时出现以下报错:
$ cmake ..
$ make -j8
[ 50%] Building CXX object CMakeFiles/bin2pcd.dir/bin2pcd.cpp.o
[100%] Linking CXX executable bin2pcd
/usr/bin/ld: CMakeFiles/bin2pcd.dir/bin2pcd.cpp.o: undefined reference to symbol '_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv@@GLIBCXX_3.4'
/usr/bin/ld: /lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/bin2pcd.dir/build.make:176:bin2pcd] 错误 1
make[1]: *** [CMakeFiles/Makefile2:76:CMakeFiles/bin2pcd.dir/all] 错误 2
make: *** [Makefile:130:all] 错误 2
尝试使用和update-alternatives相关的指令却没无济于事。
搜索“_ZNKSt9basic_iosIcSt11char_traitsIcEE4failEv@@GLIBCXX_3.4”才定位到问题:g++编译错误_undifined reference to symbol “z”-CSDN博客
解决思路应该是:将/usr/bin/g++ -> g++-7。
在此文末找到符号链接相关的内容:《在Ubuntu上安装并切换支持C++20的最新GCC版本及其与C++11版本的并行使用指南》 - 知乎
但却无法创建:
于是参考此文:ln: 无法创建符号链接‘/usr/bin/python3‘:文件已存在,解决方法_ln: 无法创建符号链接"/usr/bin/python": 文件已存在-CSDN博客
程序能运行了,但是思路还是很乱。
这里g++和gcc的符号链接都乱套了。复盘猜测应该是在:
Ubuntu20.04安装cuda10.1_there are no g++ version bounds defined for cuda v-CSDN博客
使用update-alternatives设置gcc和g++各版本的优先级的时候,输入了混淆的指令,导致后续一系列蠢问题。正确的符号链接应该是:
猜测,卸载所有g++和gcc,再重新安装,说不定能好。