This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: relocation error
- From: Vincent Torri <torri at math dot u-strasbg dot fr>
- To: Eljay Love-Jensen <eljay at adobe dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Wed, 21 Jul 2004 01:21:57 +0200 (MEST)
- Subject: Re: relocation error
i have indeed found that the problem comes from a library that is use.
I create a very small class :
in toto.h :
class Toto
{
int x;
public:
Toto(int i);
};
in toto.cpp :
#include "toto.h"
Toto::Toto(int i)
{
x = i;
}
in test.cpp :
#include "../src/toto.h"
int main ()
{
Toto tt(2);
return 0;
}
i link toto.cpp in my_lib.so
i compile test.cpp with :
g++ bin/libavisynth.so -L/home/torri/local/lib -lstlport_gcc
-L/home/torri/local/lib -lboost_thread-gcc-mt-1_31 -Wall -O2 -o bin/test
../../test/test.cpp
when i exec ./bin/test, i have:
./bin/test: relocation error: ./bin/test: undefined symbol: _ZN4TotoC1Ei
There's no problem if i link directly with toto.so and not my_lib.so
There's no problem if there's no parameters in the constructor
all the libs have been compiled with the same compiler (g++ 3.3.1)
nm ./bin/my_lib.so |grep _ZN4TotoC1Ei returns 001e8950 T _ZN4TotoC1Ei
afaik, gdb or valgrind have not helped me much.
i'm completely lost. Why this small class could not be used ?
Vincent TORRI
On Mon, 19 Jul 2004, Eljay Love-Jensen wrote:
> Hi Vincent,
>
> It appears that this is not defined at link time:
> avs::text::Font::Font(_STL::basic_string<char, _STL::char_traits<char>,
> _STL::allocator<char> > const&, int)
>
> Check your build process to make sure the source file which contains that
> routine is defined, and included in the compile, and being linked in.
>
> HTH,
> --Eljay
>
>