Relocation error with STL Map in Shared Object

Discussion in 'C++' started by, Jun 21, 2006.

  1. Guest

    Hi All,

    I'm having a problem with STL on Red Hat Linux 9, gcc 4.1.0.

    I have a Shared Object that is inserting an object into a MAP. When
    this shared object is used, I get a runtime error saying

    relocation error: /usr/lib/ undefined symbol:

    The code in the shared object is as follows:

    map<unsigned int, MyClass*> myMap;
    MyClass *pObj;
    myMap = pObj; //when I remove this line, the error disappears.

    Is there a problem with the way I am inserting the object into the map,
    or am I not linking the library properly?
    , Jun 21, 2006
    1. Advertisements

  2. Guest

    Hi again,

    Silly mistake, I was also using another shared object that was using an
    earlier version of the stdc++ library.

    Recompiled bothShared Object with the same version and the problem was
    , Jun 21, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page