Running error: undefined symbol: _ZNK5gtsam Refer to the solution

written in front

Own environment: Ubuntu18.04, ROS-melodic, source code installation gtsam

1. undefined symbol: _ZNK5gtsam16NoiseModelFactor5PrintERKNSt7 Reference solution

1. Problem description

When running the program using gtsam by itself, the compilation is successful, but the following error occurs when running:

undefined symbol: _ZNK5gtsam16NoiseModelFactor5PrintERKNSt7 

insert image description here

2. Refer to the solution

gtsam/buildExecute directly in the original gtsam compilation folder sudo make installto reinstall gtsam, and then run the program again to execute normally. (Maybe it is caused by the instability of gtsam?)
(If the above method is unsuccessful, try to build/delete the folder, execute again cmake .., make, sudo make installto reinstall gtsam.)

2. undefined symbol: _ZNK5gtsam4Rot3mlERKN5Eigen6MatrixIdLi3ELi1ELi0ELi3ELi1EEE Reference solution

1. Problem description

When running the program using gtsam by itself, the compilation is successful, but the following error occurs when running:

undefined symbol: _ZNK5gtsam4Rot3mlERKN5Eigen6MatrixIdLi3ELi1ELi0ELi3ELi1EEE

insert image description here

2. Refer to the solution

Specify the version of gtsam CMakeLists.txtin the in the error programgtsamfind_package()

find_package(GTSAM REQUIRED QUIET)

changed to

find_package(GTSAM 4 REQUIRED QUIET)

Guess you like

Origin blog.csdn.net/qq_39779233/article/details/129190690