-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
g2o最新版本使用LinearSolverCSparse时出错 #103
Comments
Update:问题没有解决,不清楚原因,目前使用git ff647bd7版本 |
我在加了以下内容以后搞定了,貌似应该是缺少了cxsparse
|
closed because the problem is solved. |
这里留个我的解决思路吧,问题的本质是最新版的g2o为了更安全的内存,强制在传参的时候需要unique指针。方法如下:
|
感谢MC275提供的建议
如果在添加之后仍然出现
那么可以通过以下,定位cs.h文件位置
之后添加至cmakelist
注意修改“g2o_test” |
下载编译最新的g2o版本(至少今年的版本),如果使用LinearSolverCSparse就会出错,比如/ch6/g2o_curve_fitting的代码,原始是使用的LinearSolverDense:
将LinearSolverDense改成LinearSolverCSparse后:
unique_ptr<Block::LinearSolverType> linearSolver{new LinearSolverCSparse<Block::PoseMatrixType>()};
出现错误:
/usr/bin/ld: CMakeFiles/Eg06_UseG2O.dir/main.cpp.o: undefined reference to symbol 'cs_di_calloc'
//usr/lib/x86_64-linux-gnu/libcxsparse.so.3.1.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [Eg06_UseG2O/Eg06_UseG2O] Error 1
make[1]: *** [Eg06_UseG2O/CMakeFiles/Eg06_UseG2O.dir/all] Error 2
make: *** [all] Error 2
其他相关的g2o代码一样会出现问题,但g2o自带的sba example却是可以运行的,google了也没有找到原因,试过重新安装新虚拟机,同样问题。
环境:ubuntu14.04, 已经安装suitsparse, csparse并cmake链接相关库
The text was updated successfully, but these errors were encountered: