Pourquoi suis-je un recherche de symbole d'erreur?

Je suis en train d'écrire une bibliothèque, qui est chargé dynamiquement dans mon principal-une application de dlsym.
J'ai les fichiers suivants:

de la bibliothèque.h

#include <ilibrary.h>
#include <igateway.h>

class LibraryImpl;

class Library: public ILibrary {
public:
    static ILibrary* instance();

    IGateway* getGateway() const;

protected:
    Library();
    virtual ~Library();

private:
    static ILibrary* instance_;
    LibraryImpl* library_;
};

extern "C" {
    IMPORT_EXPORT ILibrary* getLibrary();
}

library.cpp

#include "library.h"

#include "business/BCGateway.h"


class LibraryImpl {
public:
    IGateway* getGateway();
};

IGateway* LibraryImpl::getGateway() {
    return BCGateway::instance();
}



ILibrary* Library::instance_ = NULL;
ILibrary* Library::instance() {
    return instance_ ? instance_ : (instance_ = new Library);
}

Library::Library() {
    library_ = new LibraryImpl();
}

Library::~Library() {
    delete library_;
}

IGateway* Library::getGateway() const {
    return library_->getGateway();
}


extern "C" {
    IMPORT_EXPORT
    ILibrary* getLibrary(){
        return Library::instance();
    }
}

d'affaires/BCGateway.h

#include <igateway.h>

class BCGateway: public IGateway {
public:
    static IGateway* instance();

protected:
    BCGateway();

private:
    static IGateway* instance_;
};

business/BCGateway.cpp

#include "BCGateway.h"

IGateway* BCGateway::instance_ = NULL;
IGateway* BCGateway::instance(){
    return instance_ ? instance_ : (instance_ = new BCGateway);
}

Je peux me connecter à la bibliothèque et réussi à charger la Bibliothèque de l'instance. Mais quand je l'appelle de la bibliothèque->getGateway() dans mon principale de l'application, j'obtiens l'erreur suivante:

symbol lookup error: ./passerelles/libSwisscomXtraZone.so: undefined symbol: _ZN9BCGateway8instanceEv

Pouvez-vous svp me donner un indice, comment je peux résoudre ce problème? Je suis coincé.

Grâce.

InformationsquelleAutor Sämy | 2009-07-13