I created a c .so object, and can link successfully, I now need it to work with a cpp, so I converted my .so into a cpp, I added extern "C" to all of my functions that are needing exported, and it seems to be fine, except when its time to link it with a .cpp main
I can compile it with a .c main file, I do get warnings, but it does work
When I switch my main to a cpp the warnings seem to turn into errors
Warning in C:
implicit declaration of "Function"
Error in C++:
"Function" was not declared in scope
To Compile the c or cpp i use
Code:
$ gcc -o client client.cpp -L. -lprint
or
$ gcc -o client client.c -L. -lprint
I have followed this tutorial almost verbatim
http://www.ibm.com/developerworks/library/l-shobj/