g2o icon indicating copy to clipboard operation
g2o copied to clipboard

error while loading shared libraries: libg2o_types_slam3d.so

Open AaboutL opened this issue 2 years ago • 2 comments

I set my CMakeLists.txt like below: image Using

message("slam3d: " ${G2O_TYPES_SLAM3D})

I can get

slam3d: /home/**/3rdparty/g2o/lib/libg2o_types_slam3d.so

But when execute my sample code, I get the output like below:

/tmp/tmp.Q6L6jGxD1s/cmake-build-debug-remotehostslam/main: error while loading shared libraries: libg2o_types_slam3d.so: cannot open shared object file: No such file or directory

I have tried https://github.com/RainerKuemmerle/g2o/issues/480#issuecomment-761876244(sudo ldconfig), but it does not work. How can I solve this problem?

AaboutL avatar Aug 15 '22 16:08 AaboutL

I found a stupid solution. Since my g2o installatoin dir is not default, I write my g2o lib dir into /etc/ld.so.conf and run "ldconfig". But I still don't know why the "core" library can work while the "types slam3d" can't. They are both found and set by cmake.

AaboutL avatar Aug 16 '22 03:08 AaboutL

You can also use the LD_LIBRARY_PATH environment variable to specify where to look for libs. Why core library is not a problem is not so clear to me.

RainerKuemmerle avatar Aug 18 '22 18:08 RainerKuemmerle