-2

I am attempting to compile a shared library for Linux, using CMake under Yocto. The makefile specifies that it builds some .o objects then links them into a shared library .so. Some source files are C++, some are C. Maybe I should note that I do have source but I do not own this component, it is supposed to work out of the box.

Linking the .so fails with undefined reference to two functions which the linker notes are members of a class. This class exists but the undefined reference functions do not appear in header or source.

Grepping for the undefined functions finds results only in the binaries that were just generated. I don't understand why ld is looking for functions that, so far as I can tell, no one is asking for. Nor how do these functions appear in the binaries if they are not in header or source.

I considered just adding in the missing functions but because they are not specified anywhere I can't tell what sort of parameters they might need.

There is a small amount of documentation about this library online, it does not mention these functions either.

Jason
  • 5
  • 1
  • 6
  • 4
    Can you give some more specific examples of the error message, the class that supposedly owns the missing functions, etc? It's possible that the functions are not showing up in your grep because the names are the result of a template or macro expansion. – 0x5453 Aug 29 '23 at 15:43

0 Answers0