Ubuntu系统pangolin与libtorch所引发的连接错误
作者:互联网
在slam系统中,我使用pangolin作为可视化,一点问题都没有。
然后,我训练了一个网络,做物体检测,神奇的事情发生了:
CMakeFiles/runRoadVehicle.dir/Viewer/Viewer.cpp.o: In function `vehicle::Viewer::draw()':
/home/fy/workspace/master/hd-map-generation/src/roadPlane/src/example/Viewer/Viewer.cpp:83: undefined reference to `pangolin::CreateWindowAndBind(std::string, int, int, pangolin::Params const&)'
/home/fy/workspace/master/hd-map-generation/src/roadPlane/src/example/Viewer/Viewer.cpp:91: undefined reference to `pangolin::CreatePanel(std::string const&)'
CMakeFiles/runRoadVehicle.dir/Viewer/Viewer.cpp.o: In function `void pangolin::InitialiseNewVarMeta<bool>(pangolin::VarValue<bool>&, std::string const&, double, double, int, bool)':
/usr/local/include/pangolin/var/var.h:66: undefined reference to `pangolin::Split(std::string const&, char)'
collect2: error: ld returned 1 exit status
CMakeFiles/runRoadVehicle.dir/build.make:167: recipe for target '../bin/runRoadVehicle' failed
为什么那么多pangolin函数不出问题,就这几个出问题,百思不得其解。想想我的改动,似乎只有cmakelist中加入了libtorch库函数链接。
于是我把检测相关的代码注释掉,编译完全没有问题。这咋搞,明显是libtorch与pangolin水火不容,于是我用上了Google大法,想要找到点蛛丝马迹,看到了这位兄台的回答:
莫非只有我手动编译一下libtorch才能解决,但是我又不想重新编译,于是上官网看了一下:
发现还有一个cxx11 ABI下载链接,于是下载下来将原来的替换掉,然后再次编译工程,编译成功!
标签:std,src,const,pangolin,libtorch,Viewer,Ubuntu 来源: https://blog.csdn.net/feiyang_luo/article/details/103999125