* RE: Same internal function name in libstdc++.so.5 and libjvm.so
@ 2003-09-04 23:03 lrtaylor
2003-09-15 15:48 ` Error while building gcc 3.2.1 on RH AS 2.1 Ajay Bansal
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: lrtaylor @ 2003-09-04 23:03 UTC (permalink / raw)
To: abansal, gcc-help
You are correct. However, you can still add it explicitly to the command line with g++ (if you're using gcj, then I'm not sure). For example,
g++ -o prog file.cpp -lstdc++ -lsomeotherlib
Now, if you do an 'ldd' on 'prod', you should see libstdc++ before libsomeotherlib.
Lyle
-----Original Message-----
From: Ajay Bansal [mailto:abansal@netegrity.com]
Sent: Thursday, September 04, 2003 10:16 AM
To: gcc-help@gcc.gnu.org
Subject: RE: Same internal function name in libstdc++.so.5 and libjvm.so
But I don't _link_ with libstdc++ explicitly!!!!!!!!!!!!!!!!!!!!!!! It is
linked implicitly by g++ compiler.
(Am I correct??)
-----Original Message-----
From: lrtaylor@micron.com [mailto:lrtaylor@micron.com]
Sent: Thursday, September 04, 2003 9:39 PM
To: abansal@netegrity.com; gcc-help@gcc.gnu.org
Hi,
Can you change your link line so that libstdc++ is linked to before libjvm?
If I understand correctly, it should get the function our of the first
library linked to that defines it (I could be wrong, though...)
Lyle Taylor
-----Original Message-----
From: Ajay Bansal [mailto:abansal@netegrity.com]
Sent: Thursday, September 04, 2003 5:17 AM
To: gcc-help@gcc.gnu.org
Subject: Same internal function name in libstdc++.so.5 and libjvm.so
Hi All
We are facing a "same function name" issue in two different libraries on
Linux. My program is linked with both libstdc++ and libjvm. I am using gcc
3.2.1 on Linux.
My code has following line :
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);
Which dumps core.
As it was not very clear why this piece of code can give a dump, I changed
the code as follows:
if ( dynamic_cast<CSObject*>(m_unresolved))
dynamic_cast<CSObject*>(m_unresolved)->WriteObject(lpszSString);
Now core comes while executing "if" statement. I have checked for validity
of pointers "m_unresolved" and "lpszSString". Both are valid.
On Linux, with gcc 3.2.1, dynamic_cast internally calls function
"__dynamic_cast". Problem is - this function is present both in
libstdc++.so.5 and libjvm.so. In our code, function from libjvm is being
called. If I change dynamic_cast to simple C style cast, everything works
fine. (nm for libstdc_++ and libjvm is given below)
----------------------------------------
[abansal@linux2 lib]$ nm -A *.so.* |grep __dynamic
libstdc++.so.5:00051bc0 T __dynamic_cast .so.5.0.1:00051bc0 T
libstdc++__dynamic_cast
[abansal@linux2 lib]$ nm /usr/j2sdk1.4.1_02/jre/lib/i386/server/libjvm.so
|grep __dynamic
00485c34 T __dynamic_cast
----------------------------------------
Changing all dynamic_casts to simple C style casts in the code solves the
issue, but I know that that is undesirable. Can somebody please suggest us
what should we do in this case?
Regards
Ajay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Error while building gcc 3.2.1 on RH AS 2.1
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
@ 2003-09-15 15:48 ` Ajay Bansal
2003-09-15 15:48 ` Ajay Bansal
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-09-15 15:48 UTC (permalink / raw)
To: gcc-help
Hi All
I was building gcc 3.2.1 on RH AS 2.1. I used following for configuration
../gcc-3.2.1/configure --enable-symvers=gnu
I get the following error while doing "make bootstrap"
----------------------------------------------------------------------------
---
/home/porting/abansal/project/Code/objdir/gcc/xgcc -shared-libgcc
-B/home/porting/abansal/project/Code/objdir/gcc/ -nostdinc++
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc/.libs -B/usr/local/i686-pc-linux-gnu/bin/
-B/usr/local/i686-pc-linux-gnu/lib/ -isystem
/usr/local/i686-pc-linux-gnu/include -shared -nostdlib /usr/lib/crti.o
/home/porting/abansal/project/Code/objdir/gcc/crtbeginS.o .libs/bitset.o
.libs/codecvt.o .libs/complex_io.o .libs/concept-inst.o .libs/ctype.o
.libs/ext-inst.o .libs/fstream.o .libs/fstream-inst.o .libs/functexcept.o
.libs/globals.o .libs/io-inst.o .libs/ios.o .libs/istream-inst.o
.libs/limits.o .libs/locale.o .libs/locale-inst.o .libs/localename.o
.libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o
.libs/stdexcept.o .libs/stl-inst.o .libs/streambuf-inst.o
.libs/string-inst.o .libs/strstream.o .libs/valarray-inst.o
.libs/vterminate.o .libs/wstring-inst.o .libs/codecvt_members.o
.libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o
.libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o
.libs/basic_file.o .libs/c++locale.o -Wl,--whole-archive
../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a
-Wl,--no-whole-archive
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc/.libs -lm ../libmath/.libs/libmath.a -lm
../libsupc++/.libs/libsupc++convenience.a -lm
-L/home/porting/abansal/project/Code/objdir/gcc
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../.. -lgcc_s -lc
-lgcc_s -lm -lgcc_s -lc -lgcc_s
/home/porting/abansal/project/Code/objdir/gcc/crtendS.o /usr/lib/crtn.o
-Wl,-O1 -Wl,--version-script=linker.map -Wl,-soname -Wl,libstdc++.so.5 -o
.libs/libstdc++.so.5.0.1
/usr/bin/ld:linker.map:31: ignoring invalid character `[' in script
/usr/bin/ld:linker.map:31: parse error in VERSION script
collect2: ld returned 1 exit status
make[4]: *** [libstdc++.la] Error 1
make[4]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/sr
c'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/home/porting/abansal/project/Code/objdir'
make: *** [bootstrap] Error 2
----------------------------------------------------------------------------
---
What wrong I have done???
Regards
Ajay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Error while building gcc 3.2.1 on RH AS 2.1
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
2003-09-15 15:48 ` Error while building gcc 3.2.1 on RH AS 2.1 Ajay Bansal
@ 2003-09-15 15:48 ` Ajay Bansal
2003-10-09 10:12 ` Error with program compiled with gcc2.96 Ajay Bansal
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-09-15 15:48 UTC (permalink / raw)
To: gcc-help
Hi All
I was building gcc 3.2.1 on RH AS 2.1. I used following for configuration
../gcc-3.2.1/configure --enable-symvers=gnu
I get the following error while doing "make bootstrap"
----------------------------------------------------------------------------
---
/home/porting/abansal/project/Code/objdir/gcc/xgcc -shared-libgcc
-B/home/porting/abansal/project/Code/objdir/gcc/ -nostdinc++
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc/.libs -B/usr/local/i686-pc-linux-gnu/bin/
-B/usr/local/i686-pc-linux-gnu/lib/ -isystem
/usr/local/i686-pc-linux-gnu/include -shared -nostdlib /usr/lib/crti.o
/home/porting/abansal/project/Code/objdir/gcc/crtbeginS.o .libs/bitset.o
.libs/codecvt.o .libs/complex_io.o .libs/concept-inst.o .libs/ctype.o
.libs/ext-inst.o .libs/fstream.o .libs/fstream-inst.o .libs/functexcept.o
.libs/globals.o .libs/io-inst.o .libs/ios.o .libs/istream-inst.o
.libs/limits.o .libs/locale.o .libs/locale-inst.o .libs/localename.o
.libs/misc-inst.o .libs/ostream-inst.o .libs/sstream-inst.o
.libs/stdexcept.o .libs/stl-inst.o .libs/streambuf-inst.o
.libs/string-inst.o .libs/strstream.o .libs/valarray-inst.o
.libs/vterminate.o .libs/wstring-inst.o .libs/codecvt_members.o
.libs/collate_members.o .libs/ctype_members.o .libs/messages_members.o
.libs/monetary_members.o .libs/numeric_members.o .libs/time_members.o
.libs/basic_file.o .libs/c++locale.o -Wl,--whole-archive
../libmath/.libs/libmath.a ../libsupc++/.libs/libsupc++convenience.a
-Wl,--no-whole-archive
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc
-L/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/s
rc/.libs -lm ../libmath/.libs/libmath.a -lm
../libsupc++/.libs/libsupc++convenience.a -lm
-L/home/porting/abansal/project/Code/objdir/gcc
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1
-L/usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/../../.. -lgcc_s -lc
-lgcc_s -lm -lgcc_s -lc -lgcc_s
/home/porting/abansal/project/Code/objdir/gcc/crtendS.o /usr/lib/crtn.o
-Wl,-O1 -Wl,--version-script=linker.map -Wl,-soname -Wl,libstdc++.so.5 -o
.libs/libstdc++.so.5.0.1
/usr/bin/ld:linker.map:31: ignoring invalid character `[' in script
/usr/bin/ld:linker.map:31: parse error in VERSION script
collect2: ld returned 1 exit status
make[4]: *** [libstdc++.la] Error 1
make[4]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3/sr
c'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3'
make[2]: *** [all-recursive-am] Error 2
make[2]: Leaving directory
`/home/porting/abansal/project/Code/objdir/i686-pc-linux-gnu/libstdc++-v3'
make[1]: *** [all-target-libstdc++-v3] Error 2
make[1]: Leaving directory `/home/porting/abansal/project/Code/objdir'
make: *** [bootstrap] Error 2
----------------------------------------------------------------------------
---
What wrong I have done???
Regards
Ajay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Error with program compiled with gcc2.96
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
` (2 preceding siblings ...)
2003-10-09 10:12 ` Error with program compiled with gcc2.96 Ajay Bansal
@ 2003-10-09 10:12 ` Ajay Bansal
2003-10-28 6:12 ` mapfile Ajay Bansal
2003-10-28 6:12 ` mapfile Ajay Bansal
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-10-09 10:12 UTC (permalink / raw)
To: gcc-help
Hi All
I am compiling a program with gcc 2.96 on RedHat Advanced Server 2.1.
When I run the program, I get following error :
Cannot load /home/ajay/libmod.so into server: /home/ajay/libmod.so:
undefined symbol: __pure_virtual
Why I am getting this error :
undefined symbol: __pure_virtual
& How do I resolve this?
Regds
Ajay
^ permalink raw reply [flat|nested] 7+ messages in thread
* Error with program compiled with gcc2.96
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
2003-09-15 15:48 ` Error while building gcc 3.2.1 on RH AS 2.1 Ajay Bansal
2003-09-15 15:48 ` Ajay Bansal
@ 2003-10-09 10:12 ` Ajay Bansal
2003-10-09 10:12 ` Ajay Bansal
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-10-09 10:12 UTC (permalink / raw)
To: gcc-help
Hi All
I am compiling a program with gcc 2.96 on RedHat Advanced Server 2.1.
When I run the program, I get following error :
Cannot load /home/ajay/libmod.so into server: /home/ajay/libmod.so:
undefined symbol: __pure_virtual
Why I am getting this error :
undefined symbol: __pure_virtual
& How do I resolve this?
Regds
Ajay
^ permalink raw reply [flat|nested] 7+ messages in thread
* mapfile
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
` (3 preceding siblings ...)
2003-10-09 10:12 ` Ajay Bansal
@ 2003-10-28 6:12 ` Ajay Bansal
2003-10-28 6:12 ` mapfile Ajay Bansal
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-10-28 6:12 UTC (permalink / raw)
To: gcc-help
Does Linux/gcc support a mapfile syntax, so that we can hide/export symbols
in shared lib on Linux as well?
^ permalink raw reply [flat|nested] 7+ messages in thread
* mapfile
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
` (4 preceding siblings ...)
2003-10-28 6:12 ` mapfile Ajay Bansal
@ 2003-10-28 6:12 ` Ajay Bansal
5 siblings, 0 replies; 7+ messages in thread
From: Ajay Bansal @ 2003-10-28 6:12 UTC (permalink / raw)
To: gcc-help
Does Linux/gcc support a mapfile syntax, so that we can hide/export symbols
in shared lib on Linux as well?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-10-28 6:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-04 23:03 Same internal function name in libstdc++.so.5 and libjvm.so lrtaylor
2003-09-15 15:48 ` Error while building gcc 3.2.1 on RH AS 2.1 Ajay Bansal
2003-09-15 15:48 ` Ajay Bansal
2003-10-09 10:12 ` Error with program compiled with gcc2.96 Ajay Bansal
2003-10-09 10:12 ` Ajay Bansal
2003-10-28 6:12 ` mapfile Ajay Bansal
2003-10-28 6:12 ` mapfile Ajay Bansal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).