[自用 | bug-fixed] bin2pcd: /usr/bin/ld 问题

小白,啥也不懂,本文仅自己修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,再重新安装,说不定能好。

  • 8
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
ESP32C3, esp-idf 4.3.5,编译报错。FAILED: wifi_softAP.elf cmd.exe /C "cd . && D:\Espressif\tools\riscv32-esp-elf\esp-2021r2-patch3-8.4.0\riscv32-esp-elf\bin\riscv32-esp-elf-g++.exe -march=rv32imc -nostartfiles -march=rv32imc --specs=nosys.specs @CMakeFiles\wifi_softAP.elf.rsp -o wifi_softAP.elf && cd ." d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: esp-idf/main/libmain.a(softap_example_main.c.obj): in function `ch623_task': d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:164: undefined reference to `CH623_Init' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:166: undefined reference to `pcd_lpcd_start' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:168: undefined reference to `pcd_lpcd_application' d:/espressif/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/8.4.0/../../../../riscv32-esp-elf/bin/ld.exe: d:\espressif\frameworks\esp-idf-v4.3.5\examples\wifi\esp32_config_wifi\build/../main/softap_example_main.c:171: undefined reference to `pcd_lpcd_start' collect2.exe: error: ld returned 1 exit status ninja: build stopped: subcommand failed. ninja failed with exit code 1
05-31

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值