On Jun 26, 3:53*pm, Ian Collins <ian-n...@hotmail.com> wrote:
> HelloLinux wrote:
> > The following is how I encouted my problems:
>
> > 1) Compile print.cpp into libprint.so by Sun C++ 5.9.The command is:
> > CC -G -KPIC -o libprint.so print.cpp
> > It succeeds.
>
> > 2)Compile debug.cpp into libdebug.so by g++ 3.4.6, debug.cpp calls a
> > function defined in libprint.so. The command is:
> > g++ -shared -fPIC -o libdebug.so debug.cpp -lprint -L.
> > It succeeds too.
>
> You can't mix libraries compiled with one C++ compiler with code
> compiled with another. *Well OK you can, provided the functions exported
> by the library have C linkage (declared as extern "C").
>
> --
> Ian Collins.
Thanks a lots, I will try to find a way out to compile all my libs
using g++.
|