Recently, I built a large dynamic library using codeblocks, the library is cpp source file, and it depends on another library which is also cpp source file, at the linking step, the codeblocks showed me a message " undefined reference to ...", It mean that the linker could not found some functions which are in another library, but I searched and read the source file, the corresponding functions was fine and perfect.
So I picked up a function and modified it , and rebuilt, I found if I add extern "C" keywards to the head of the function, the undefined reference message was dispeared, for example:
if the function is like this:
EAIO_API bool Create(const char16_t* pDirectory), the undefined reference message will appear.
if the function is modified to this:
extern "C" EAIO_API bool Create(const char16_t* pDirectory); the undefined reference message will dispear.
how this happens? did I forgot to add something? Can anybody help me?