public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* relocation error
@ 2004-07-18  9:02 Vincent Torri
  2004-07-19 12:41 ` Eljay Love-Jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Torri @ 2004-07-18  9:02 UTC (permalink / raw)
  To: gcc-help


hello,

i have a problem during the execution of one of my prog.
I'm using stlport, and, at execution time, i have:

./bin/test: relocation error: ./bin/test: undefined
symbol: _ZN3avs4text4FontC1ERKN4_STL12basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEEi

ldd ./bin/test returns me:

        libavisynth.so.3 => /home/torri/local/lib/libavisynth.so.3
(0x40015000)
        libstlport_gcc.so => /home/torri/local/lib/libstlport_gcc.so
(0x4028f000)
        libboost_thread-gcc-mt-1_31.so.1.31.0 =>
/home/torri/local/lib/libboost_thread-gcc-mt-1_31.so.1.31.0 (0x40357000)
        libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x40360000)
        libm.so.6 => /lib/i686/libm.so.6 (0x4042e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40451000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x4045a000)
        libc.so.6 => /lib/i686/libc.so.6 (0x404aa000)
        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x405da000)
        libz.so.1 => /lib/libz.so.1 (0x4062f000)
        librt.so.1 => /lib/i686/librt.so.1 (0x4063d000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

this error appears when the following constructor:

Font(std::string const& name, int size);

is called.
What i don't understand is that I have this operator:

PClip Parser::operator ()(std::string const& src)

and g++ does not complain about it.

does someone know where i am wrong ?

Thank you !

Vincent TORRI


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: relocation error
  2004-07-18  9:02 relocation error Vincent Torri
@ 2004-07-19 12:41 ` Eljay Love-Jensen
  2004-07-20 23:22   ` Vincent Torri
  0 siblings, 1 reply; 5+ messages in thread
From: Eljay Love-Jensen @ 2004-07-19 12:41 UTC (permalink / raw)
  To: Vincent Torri, gcc-help

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: relocation error
  2004-07-19 12:41 ` Eljay Love-Jensen
@ 2004-07-20 23:22   ` Vincent Torri
  2004-07-20 23:41     ` Eljay Love-Jensen
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Torri @ 2004-07-20 23:22 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: gcc-help


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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: relocation error
  2004-07-20 23:22   ` Vincent Torri
@ 2004-07-20 23:41     ` Eljay Love-Jensen
  2004-07-21  4:43       ` Vincent Torri
  0 siblings, 1 reply; 5+ messages in thread
From: Eljay Love-Jensen @ 2004-07-20 23:41 UTC (permalink / raw)
  To: Vincent Torri; +Cc: gcc-help

Hi Vincent,

For your target executable, you should also link against your my_lib.so file.

You can double check your test executable with "ldd test".

HTH,
--Eljay

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: relocation error
  2004-07-20 23:41     ` Eljay Love-Jensen
@ 2004-07-21  4:43       ` Vincent Torri
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent Torri @ 2004-07-21  4:43 UTC (permalink / raw)
  To: Eljay Love-Jensen; +Cc: gcc-help



i have, my_lib.so was libavisynth.co (a typo...)

Vincent TORRI


On Tue, 20 Jul 2004, Eljay Love-Jensen wrote:

> Hi Vincent,
> 
> For your target executable, you should also link against your my_lib.so file.
> 
> You can double check your test executable with "ldd test".
> 
> HTH,
> --Eljay
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-07-21  4:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-18  9:02 relocation error Vincent Torri
2004-07-19 12:41 ` Eljay Love-Jensen
2004-07-20 23:22   ` Vincent Torri
2004-07-20 23:41     ` Eljay Love-Jensen
2004-07-21  4:43       ` Vincent Torri

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).