g++ undefined reference although symbol is present in *.so file

前端 未结 2 1563
日久生厌
日久生厌 2020-12-29 19:18

I found a number of similar questions (e.g. this, that or this), but none of them helped me solve my problem. I have a *.so file (from the core of gnss-sdr) that, as indicat

相关标签:
2条回答
  • 2020-12-29 19:37

    I have found in the past that this type of error is caused by the lack of proper extern "C" { ... } bracketing in an include file.

    0 讨论(0)
  • 2020-12-29 19:42

    The pedantically correct way to check that a .so exports a symbol is nm --demangle --dynamic --defined-only --extern-only <lib.so> | grep <symbol>.

    Without --defined-only your command also shows undefined symbols.

    Without --extern-only it also shows symbols with internal linkage which are unavailable for linking.

    It looks like you need to link another library because Gps_Ephemeris::Gps_Ephermeris() is not resolved by linking libgnss_system_parameters_dyn.so. A good way to start is that library's documentation and examples.

    0 讨论(0)
提交回复
热议问题