This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linking shared library, undefined symbol __pure_virtual
- From: Kris Munch <krmunch at yahoo dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 1 Nov 2004 11:29:26 -0800 (PST)
- Subject: Linking shared library, undefined symbol __pure_virtual
Hello -
I have a legacy c++ function that I need to link into
a shared library, so that a c function can call it.
The c function is them called from within oracle using
extproc (external procedure). I can use the c++ and c
library from an executable that I compile using g++,
but oracle is having trouble calling the c++ function,
and gives this error:
"undefined symbol __pure_virtual".
I assume this has to do with linking the c++ library.
I have tried many different command for this,
including using ld and g++. This is the ld command I
tried:
/usr/bin/ld -shared
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96
-L/usr/lib/gcc-lib/i386-redhat-linux/2.96/../../..
-L/usr/oracle/OraHome1/lib
-L/usr/oracle/OraHome1/lib/krm
-o libaddimgs.so addimgs.o
/usr/oracle/OraHome1/lib/libpls9.a
-lgcc -lstdc++ -lm -lgcc -lc -lgcc -lclntsh
-lpsyimg `cat /usr/oracle/OraHome1/lib/sysliblist`
-ldl -lm
-rpath
/usr/oracle/OraHome1/lib/krm:/usr/oracle/OraHome1/lib
I have also tried this g++ command:
g++ -shared -o libaddimgs.so -lc addimgs.o -lpsyimg
-L/usr/oracle/OraHome1/lib
-L/usr/oracle/OraHome1/lib/krm -lpthread -lm -ldl
-lstdc++ -lm -lgcc -lc -lgcc
THe ld command is the one that gives __pure_virtual
error. When i try to use the g++ command, I get an RPC
connection error, which basically means the call to
the function crashed/failed.
I can nm libgcc.a and see the __pure_virtual symbol. I
am linking in -lgcc in my command, so it should find
it.
ANy ideas?
__________________________________
Do you Yahoo!?
Check out the new Yahoo! Front Page.
www.yahoo.com