IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Ogre Discussion :

Undefined reference


Sujet :

Ogre

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2012
    Messages : 6
    Par défaut Undefined reference
    Bonjour, j'ai encore un problème: mon ordinateur m'affiche ceci:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    release/main.o:main.cpp:(.text+0xc2): undefined reference to `Ogre::Root::~Root()'
    release/main.o:main.cpp:(.text+0xca): undefined reference to `Ogre::NedPoolingImpl::deallocBytes(void*)'
    release/main.o:main.cpp:(.text+0xff): undefined reference to `Ogre::Root::startRendering()'
    release/main.o:main.cpp:(.text+0x4bc): undefined reference to `Ogre::Vector3::ZERO'
    release/main.o:main.cpp:(.text+0x567): undefined reference to `Ogre::OverlayManager::getSingleton()'
    release/main.o:main.cpp:(.text+0x573): undefined reference to `Ogre::OverlayManager::getByName(std::string const&)'
    release/main.o:main.cpp:(.text+0x5a7): undefined reference to `Ogre::LogManager::getSingletonPtr()'
    release/main.o:main.cpp:(.text+0x5c3): undefined reference to `Ogre::LogManager::logMessage(std::string const&, Ogre::LogMessageLevel, bool)'
    release/main.o:main.cpp:(.text+0x9d8): undefined reference to `OIS::InputManager::createInputSystem(std::multimap<std::string, std::string, std::less<std::string>, std::allocator<std::pair<std::string const, std::string> > >&)'
    release/main.o:main.cpp:(.text+0xa14): undefined reference to `OIS::InputManager::createInputObject(OIS::Type, bool, std::string const&)'
    release/main.o:main.cpp:(.text+0xa63): undefined reference to `OIS::InputManager::createInputObject(OIS::Type, bool, std::string const&)'
    release/main.o:main.cpp:(.text+0xab2): undefined reference to `OIS::InputManager::createInputObject(OIS::Type, bool, std::string const&)'
    release/main.o:main.cpp:(.text+0xb17): undefined reference to `Ogre::Overlay::show()'
    release/main.o:main.cpp:(.text+0xb29): undefined reference to `Ogre::WindowEventUtilities::addWindowEventListener(Ogre::RenderWindow*, Ogre::WindowEventListener*)'
    Est ce que quelqu'un pourrait m'aider?

    Mon code se compose de 2 classes , le main et PremierApplication qui herite de ExemlpeApplication
    main:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    #include <Ogre.h>
    #include "PremiereApplication.h"
     
    #if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #define WIN32_LEAN_AND_MEAN
    #include "windows.h"
     
    INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
    #else
    int main(int argc, char **argv)
    #endif
    {
        PremiereApplication app;
     
        try {
            app.go();
        } catch(Ogre::Exception& e){
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
            MessageBoxA(NULL, e.getFullDescription().c_str(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    #else
            fprintf(stderr, "An exception has occurred: %s\n",
                e.getFullDescription().c_str());
    #endif
        }
     
        return 0;
    }
    et fichier .h:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    #ifndef PREMIEREAPPLICATION_H
    #define PREMIEREAPPLICATION_H
     
    #include "ExampleApplication.h"
     
    class PremiereApplication : public ExampleApplication
    {
    public:
        void createScene()
        {
        }
    };
     
    #endif // PREMIEREAPPLICATION_H

  2. #2
    Membre émérite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mars 2011
    Messages
    633
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2011
    Messages : 633
    Par défaut
    Salut,

    Tu ne dis pas à ton compilo de linker avec les lib de Ogre.
    Je te laisse revoir tes cours de C++ pour savoir comment linker une lib, à quoi ça sert, ...

    Sinon, sous visual c'est click droit sur le projet->Linker->Input->Additional Dependencies, là tu rajoute Ogre.lib (ou un truc dans le genre, je ne me souviens plus du nom).

    Ensuite, tu vas dans Linker->General->Additional Library Directory et tu rajoute le path vers Ogre.lib.

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2012
    Messages : 6
    Par défaut
    Merci pour ta réponse mais je l'ai déja inclus dans le fichier .pro ( je suis sur Qt donc il n'y a pas de raccourcis et il faut l'inclure dans le .pro)

    voici le .pro:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    TEMPLATE = app
    TARGET = Armageddon
    DEFINES -= UNICODE
     
    unix {
        INCLUDEPATH += C:/*chemin vers Ogre*//include/OGRE
        CONFIG += link_pkgconfig
        PKGCONFIG += OGRE
    }
    win32 {
        LIBS += -L(OGRE_HOME) -luser32
     
        LIBS += -L$(OGRE_HOME)//boost//lib
        debug:LIBS += -L$(OGRE_HOME)//lib//debug
        INCLUDEPATH += $(OGRE_HOME)//include
        INCLUDEPATH += $(OGRE_HOME)//include//OGRE
        INCLUDEPATH += $(OGRE_HOME)//boost
    }
     
    win32:CONFIG(release, debug|release){
        LIBS += -L"C:/*chemin vers Ogre*//lib/release" -lOIS
        LIBS += -L"C:/*chemin vers Ogre*//lib/release" -lOgreMain
    }
     
    win32:CONFIG(debug, debug|release){
        LIBS += -L$OGRE_HOME/lib/debug -lOIS_d
        LIBS += -L$OGRE_HOME/lib/debug -lOgreMain_d
    }
     
     
     
    HEADERS += \
        PremiereApplication.h
     
    SOURCES += \
        main.cpp

  4. #4
    Membre émérite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mars 2011
    Messages
    633
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2011
    Messages : 633
    Par défaut
    win32 {
    LIBS += -L(OGRE_HOME) -luser32
    Manque pas un $ ici ?
    Sinon je ne connais pas QTCreator, donc je ne peux pas trop t'aider...
    Mais en tout cas il s'agit bien d'un problème d'édition de lien.

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Avril 2012
    Messages
    6
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Avril 2012
    Messages : 6
    Par défaut
    Salut, j'ai fait ce que tu m'as dit mais ca ne change rien.

  6. #6
    Candidat au Club
    Profil pro
    Inscrit en
    Novembre 2010
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2010
    Messages : 3
    Par défaut solution
    Bonjour a tu trouvé une solution a ton problème?

    Je suis sur linux, j'utilise ogre 1.8 compilé manuellement depuis les sources avec OIS 1.3 (j'ai essayé 1.2 mais meme probleme).

    Je link la bibliothèque dans mon pro :

    LIBS += -L -libOIS-1.2.0 \

    INCLUDEPATH += /usr/include/OIS/ \

    et en console j'ai vérifié que libOIS-1.2 ou LibOIS était présent avec un locate apres avoir fait updatedb....


    je rajoute le #include <OIS.h>

    ça compile mais s'arrete au linkage ou j'ai undefined reference pour tout ce qui attrait à l'IOS::inputManager seulement...

    Des idées?
    Merci!

    Cordialement

    hugox

Discussions similaires

  1. winsock.h : undefined reference...
    Par abraxas dans le forum Dev-C++
    Réponses: 14
    Dernier message: 06/08/2012, 13h42
  2. Undefined reference compilation réseau
    Par Ren97 dans le forum Dev-C++
    Réponses: 11
    Dernier message: 08/03/2005, 09h46
  3. Compilation de xmms : undefined reference to...
    Par Michaël dans le forum Applications et environnements graphiques
    Réponses: 4
    Dernier message: 04/02/2005, 19h05
  4. undefined reference to `xmlParseFile'
    Par Clemaster dans le forum Autres éditeurs
    Réponses: 2
    Dernier message: 25/06/2004, 20h38
  5. g++ : undefined reference to ...
    Par le_barbu dans le forum Autres éditeurs
    Réponses: 16
    Dernier message: 14/05/2004, 07h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo