This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc 3.2.3 link error



Did you try to invoke "gcc" instead of "ld" to link your program? After you get the .o file, try this line:


gcc -shared test.o -o test.so -lstdc++ -lc

Christina






From: Philip Cheng <cheng@pcigeomatics.com>
To: Lars Schouw <gccmailinglist@yahoo.com>
CC: <gcc-help@gcc.gnu.org>
Subject: Re: gcc 3.2.3 link error
Date: Thu, 1 May 2003 09:40:21 -0400 (EDT)

Lars:

Here is a simple example

test.cpp:

void operator delete[](void * pPtr) throw()
{
}

gcc -v -g -c test.cpp

ld -lc -lstdc++ -shared test.o -o test.so

ld: test.so: undefined versioned symbol name _ZdaPv@@GLIBCPP_3.2
ld: failed to set dynamic section sizes: Bad value

It used to work fine in gcc 3.1. Is this a gcc 3.2 bug?

Thanks

Philip

Here is the output from gcc -v:

Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/specs
Configured with: ../gcc-3.2.3/configure --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.2.3
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/cc1plus -v -D__GNUC__=3
-D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=3 -D__GXX_ABI_VERSION=102
-D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__
-D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix
-D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386
-Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__
-D__tune_pentiumpro__ test.cpp -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS
-quiet -dumpbase test.cpp -g -version -o /usr/tmp/cc0o0Rkb.s
GNU CPP version 3.2.3 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2.3 (i686-pc-linux-gnu)
	compiled by GNU C version 3.2.3.
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory "/usr/local/i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/c++/3.2.3
 /usr/local/include/c++/3.2.3/i686-pc-linux-gnu
 /usr/local/include/c++/3.2.3/backward
 /usr/local/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include
 /usr/include
End of search list.
 as -V -Qy -o test.o /usr/tmp/cc0o0Rkb.s
GNU assembler version 2.13.90.0.2 (i386-redhat-linux) using BFD version
2.13.90.0.2 20020802




On Wed, 30 Apr 2003, Lars Schouw wrote:


> Philip,
>
> What parameters did you pass into the c compiler and
> what parameters to the linker?
>
> You can do a gcc -v end send the output.
> Then it is easier to tell.
> Lars
> --- Philip Cheng <cheng@pcigeomatics.com> wrote:
> >
> > Dear List:
> >
> > I am compiling a function using gcc 3.2.3 on Red Hat
> > 8.0
> >
> > void operator delete[](void * pPtr) throw()
> > {
> >     MemFree(pPtr);
> > }
> >
> > When I tried to build a shared object library, it
> > gave me the error
> >
> > undefined versioned symbol name _ZdlPv@@GLIBCPP_3.2
> > ld: failed to set dynamic section sizes: Bad value
> >
> >
> > It works fine with gcc 3.1 and Red Hat 7.2.  Any
> > ideas how to solve it?
> >
> > Thanks
> >
> > Philip
> >
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>



_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]