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

Fix Linking Error Caused by Protobuf #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Zi7ar21
Copy link

@Zi7ar21 Zi7ar21 commented Mar 10, 2024

Whenever I attempt to run make, it fails because ld can't find "_ZN4absl12lts_2023080212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc":

[jacob@jacobarch build]$ make
[  0%] Built target gnss-sdr-monitor_autogen_timestamp_deps
[  4%] Built target gnss-sdr-monitor_autogen
[  8%] Linking CXX executable gnss-sdr-monitor
/usr/bin/ld: CMakeFiles/gnss-sdr-monitor.dir/channel_table_model.cpp.o: undefined reference to symbol '_ZN4absl12lts_2023080212log_internal17MakeCheckOpStringIllEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEET_T0_PKc'
/usr/bin/ld: /usr/lib/libabsl_log_internal_check_op.so.2308.0.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/gnss-sdr-monitor.dir/build.make:420: src/gnss-sdr-monitor] Error 1
make[1]: *** [CMakeFiles/Makefile2:101: src/CMakeFiles/gnss-sdr-monitor.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[jacob@jacobarch build]$

This can be fixed by implementing the changes found here: https://stackoverflow.com/a/77151107

Basically, changing:

find_package(Protobuf REQUIRED)

in CMakeLists.txt to:

find_package(Protobuf REQUIRED CONFIG)

which causes CMake to say:

Unknown CMake command "protobuf_generate_cpp"

but it's OK because you can make it shut up by adding -Dprotobuf_MODULE_COMPATIBLE:BOOL=ON when you run cmake (I added the updated CMake command to the README).

@Zi7ar21
Copy link
Author

Zi7ar21 commented Sep 26, 2024

@acebrianjuan

I replaced protobuf::libprotobuf with Protobuf_LIBRARIES, as per https://cmake.org/cmake/help/latest/module/FindProtobuf.html

I also changed the Minimum CMake version to 3.30 to remove the FindBoost module removal policy that can be shown with `cmake --help-policy CMP0167`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant