I'm experiencing a strange build issue on Linux and would like to know how this could happen, since it doesn't seem possible.
My project is a static library, 'libMyLib.a', and consists of a single source file, 'MyClass.cpp'. It's built with CMake and the gcc toolchain.
Using 'nm', I've determined that 'MyClass.cpp.o' contains the 'MyClass' symbol (i.e. it is "defined" as 'V' according to 'nm'). Using 'ar', I've determined that 'libMyLib.a' contains 'MyClass.cpp.o'.
But according to 'nm', the symbol 'MyClass' is "undefined" as 'U' within 'libMyLib.a'. How can it contain the object file, but the symbol within that object file is undefined?