Skip to content
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

compile and install g2o with OpenMP, but build my program with error undefined reference to symbol 'omp_set_lock@@OMP_3.0' #601

Closed
charon-cheung opened this issue Sep 17, 2022 · 4 comments
Labels

Comments

@charon-cheung
Copy link

/usr/bin/ld: CMakeFiles/ls_slam_g2o.dir/src/main.cpp.o: undefined reference to symbol 'omp_set_lock@@OMP_3.0'
//usr/lib/x86_64-linux-gnu/libgomp.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

void lock() { omp_set_lock(&_lock); } is defined in openmp_mutex.h, how to solve this ?

@RainerKuemmerle
Copy link
Owner

https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html
Try to add openmp on your target. g2o misses to correctly export the OpenMP flags.

@charon-cheung
Copy link
Author

charon-cheung commented Sep 19, 2022

https://cliutils.gitlab.io/modern-cmake/chapters/packages/OpenMP.html Try to add openmp on your target. g2o misses to correctly export the OpenMP flags.

catkin_make done, but it that all ? Do I need to edit my cpp code?

Copy link

github-actions bot commented Jan 1, 2025

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.

@github-actions github-actions bot added the Stale label Jan 1, 2025
Copy link

This issue was closed because it has been stalled for 14 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants