[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#140186: Acknowledgement (g++-3.0, result of using the : undefined



On Fri, 2002-03-29 at 14:24, mffm Matt Flax wrote:
> Please find attatched a complete shared library project and Makefile.
> 
> a] tar zxpvf g++-3.0-possible-bug.tar.gz ; cd g++-3.0-possible-bug
> b] make
> c] export LD_LIBRARY_PATH=.
> d] /sbin/ldconfig
> e] ./HelloWorldExample
> ./HelloWorldExample: relocation error: ./libHelloWorld.so.1: undefined
> symbol: __dso_handle
> 
> That is the result !
> 
> 
> Info again :
> flatmax@relationax:~/research/g++-3.0-possible-bug$ ld -v
> GNU ld version 020326 20020326
> flatmax@relationax:~/research/g++-3.0-possible-bug$ g++-3.0 -v
> Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.4/specs
> Configured with: ../src/configure -v
> --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr
> --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as
> --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls
> --without-included-gettext --disable-checking --enable-threads=posix
> --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc
> i386-linux
> Thread model: posix
> gcc version 3.0.4

Thanks for the testcase.  I think the error is in your makefile:

ld -shared -soname libHelloWorld.so.1 -o libHelloWorld.so.1 HelloWorld.o

You mustn't invoke "ld" directly to build a shared library.  Instead,
you should use gcc like this:

gcc -shared -Wl,-soname -Wl,libHelloWorld.so.1 -o libHelloWorld.so.1
HelloWorld.o

With that change, your example program seems to work fine.

p.



-- 
To UNSUBSCRIBE, email to debian-gcc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: