1) I compile the C++ Library with the following command:
CC -G -o ./libCPP.so ./cpp_funcs.cpp
2) and then compile the program with the following command:
cc -o ./binary ./main.c ./libCPP.so
the library compilation runs smoothly, but the program compilation gives the following output:
==============================================================================
Undefined first referenced
symbol in file
__1cDstd2l6Frn0ANbasic_ostream4Ccn0ALchar_traits4Cc____pkc_2_ ./libCPP.so
__1cDstdEcout_ ./libCPP.so
ld: fatal: Symbol referencing errors. No output written to ./binary
==============================================================================
Apparently (to my humble comprehension) the linker can't bind those two symbols
...well, I interrupt the description of this problem, (this may sound crazy) but in the interim that I was describing this problem, I have come to a solution, and as I have come this far, I'll describe where was my mistake.
The problem ocurred because when I issued the second command, the linker couldn't determine where those two "undefined symbols" listed above resided, and they were "undefined" because when I issued the first command I forgot to specify where they were. So, instead I modified the first command for the following:
CC -G -o ./libCPP.so ./cpp_funcs.cpp -lCstd
(note that I added the "Cstd" library, and that's where those two symbols reside)
So, what apparently ocurred was that, as I didn't specify the location of those symbols, the resolution (or binding) of them both were delayed to a later time, and that "later time" never came, so -obviously- the linker wasn't able to produce a complete binary with all of the symbols resolved.
When I finally added the "-lCstd" parameter to the first command, that resolution wasn't necessary in a posterior time, so I was able to put all of the C++ code that I wanted in the C++ library, and then call a <extern "C">'ed function from the entrails of a C program.
Final Conclusion: Everytime that you got an "Undefined Symbol" error, there is some reference to an external function/variable/something that hasn't been resolved.