This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler gcc
- From: "Claudio Bley" <bley at cs dot uni-magdeburg dot de>
- To: Mathias Bordier <mathias_bordier at yahoo dot fr>
- Cc: gcc-help at gnu dot org
- Date: Tue, 23 Jul 2002 22:19:18 +0200
- Subject: Re: Compiler gcc
- References: <20020717075621.3676.qmail@web14501.mail.yahoo.com>
>>>>> "Mathias" == Mathias Bordier <mathias_bordier@yahoo.fr> writes:
Mathias> Hello, I want to create a dynamic library with the
Mathias> compiler gcc.2.7.2.3 on Sun-Solaris.2.5 for C++ code. I
Mathias> use JNI (Java Native Interface) for interfacing Java and
Mathias> C++. I compile and I link for creating a dynamic library
Mathias> (it's OK) and when I want to use this library, I see the
Mathias> message:
Mathias> ld.so.1: fatal: relocation error: file mylib.so: symbol
Mathias> __builtin_new: refrenced symbol not found
Mathias> I understand that the dynamic library I have created is
Mathias> not good !
Mathias> Maybe I have made an error when I compile or link my
Mathias> program C++:
Mathias> I have write: for compiling: g++ -I ... -c mylib.cc
Try with -fPIC in order to produce position independent code.
Mathias> for linking: g++ -shared -o mylib.so mylib.o -lstc++
Mathias> -lg++
I think you don't need to specify stdc++ (it's a typo in your command
isn't it?) and g++ library in this step - it doesn't hurt though.
HTH
Claudio