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

ODE Discussion :

le compiler avec visual c++ express


Sujet :

ODE

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre à l'essai
    Inscrit en
    Novembre 2006
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 6
    Par défaut le compiler avec visual c++ express
    Je voudrais utiliser la bibliothèque ODE (moteur physique).
    J’ai fait un petit programme c++ avec SDL - OpenGL, représentant un cube en 3D, compilé avec visual C++ express.

    Jusque la tout marche.

    J’ai instalé ODE.

    J'ai mis #include « ode.h » et en déclarant des variables, ça compile.

    Mais des que j’utilise une fonction ODE, paf, plein de messages d’erreurs !

    1>Linking...
    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(fflush.obj) : error LNK2005: _fflush already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(realloc.obj) : error LNK2005: _realloc already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj)
    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj)
    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj)
    1>LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj)
    1>LIBCMT.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR80.dll)
    1>LIBCMT.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR80.dll)
    1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: _fclose already defined in LIBCMT.lib(fclose.obj)
    1>MSVCRT.lib(MSVCR80.dll) : error LNK2005: __isctype already defined in LIBCMT.lib(isctype.obj)
    1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
    1>ode.lib(error.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    1>SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol _SDL_main
    1>F:\programmes\vcpp\Projects\template_sdl3d\Release\template_sdl3d.exe : fatal error LNK1120: 4 unresolved externals
    J’ai pourtant bien linké en ajoutant la lib “ode.lib”
    Et puis les erreurs sont dans les fichiers de ODE….


    On dirait qu il y a des conflits entre les bibliothèques.. je sais vraiment pas quoi faire

  2. #2
    Membre émérite Avatar de Jérémy Lefevre
    Homme Profil pro
    Développeur Java
    Inscrit en
    Juin 2004
    Messages
    898
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : Luxembourg

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2004
    Messages : 898
    Par défaut
    hmmm deja a tu verifié que les fonctions que tu utilises sont presentent dans la lib... mais jne pense pas que ca soit le problème, tu mettrait des ifndef endif autour de ton inclusion pourrai t'aidé je pense!

  3. #3
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    Il y a un conflit, là...
    Il ne devrait pas y avoir MSVCRT et LIBCMT dans le même projet...

    Mon conseil: Tu en choisis une (MSVCRT par exemple), tu règles ton projet en Run-Time Library : Multithreaded DLL (/MD), et tu vérifies un à un tes fichiers sources pour être sûr qu'ils ont tous le même réglage...
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  4. #4
    Membre à l'essai
    Inscrit en
    Novembre 2006
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 6
    Par défaut
    Dans configuration Proprieties>Linker>Input>Ignore Specific librairie
    J’ai ajouté LIBCMT.lib ;

    Et le confli semble ne plus avoir lieu.

    Le Code generation>Runtime Librairie
    Etait déjà en Multithreaded DLL (/MD)

    Si je compile sans utiliser de fonction, juste des variables ode, ça marche tres bien.

    Maintenant j’ai des petits problèmes avec ode quand j’utilise une fonction :


    dWorldID world = dWorldCreate();
    j’ai cela qui s'affiche :

    1>ode.lib(error.obj) : error LNK2001: unresolved external symbol __iob
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol __iob
    1>ode.lib(error.obj) : error LNK2001: unresolved external symbol __imp__MessageBoxA@16
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)

    Pourtant j’ai bien mis ode.lib dans le /lib de VC, et le dll dans le /bin.

    Je sais pas ce qui manque.

    Ps : ya plusieurs version des DLL et lib (realize et debug)
    J’ai pris realise, et compilé le projet en realise.

    Je sais pas trop quoi faire de plus

  5. #5
    Expert éminent
    Avatar de Médinoc
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Septembre 2005
    Messages
    27 395
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Septembre 2005
    Messages : 27 395
    Par défaut
    MessageBox est fourni par la bibliothèque d'importation USER32.LIB.
    Pour la classe std::_String_base, je pense qu'il te manque la bibliothèque run-time C++.
    Pour iob, aucune idée.

    Conseil: Vérifie que tu es bien toujours en /MD pour les deux fichiers concernés (error et convex)
    SVP, pas de questions techniques par MP. Surtout si je ne vous ai jamais parlé avant.

    "Aw, come on, who would be so stupid as to insert a cast to make an error go away without actually fixing the error?"
    Apparently everyone.
    -- Raymond Chen.
    Traduction obligatoire: "Oh, voyons, qui serait assez stupide pour mettre un cast pour faire disparaitre un message d'erreur sans vraiment corriger l'erreur?" - Apparemment, tout le monde. -- Raymond Chen.

  6. #6
    Membre à l'essai
    Inscrit en
    Novembre 2006
    Messages
    6
    Détails du profil
    Informations forums :
    Inscription : Novembre 2006
    Messages : 6
    Par défaut
    Pour MessageBox c’est bien user32.lib.

    Pour fixer le problème avec iob, il faut LIBCMT.lib

    J’ai donc choisi d’ignorer plutôt MSVCRT.lib.

    Mais il me reste :
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)
    1>ode.lib(convex.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)
    Sur :
    http://www.differentpla.net/content/...ring-base-xran

    This is because Microsoft, in their infinite wisdom have put the VC6 version of libcp.lib in the Platform SDK. And if you've got the Platform SDK\Lib directory before the Vc7\Lib directory in your settings, you'll get this library, which doesn't match the include file in Vc7\Include.
    To fix it, either delete this bogus file, or choose a multi-threaded (_MT) or MSVCRT.DLL (_DLL) build.
    Donc il me re faudrait MSVCRT.lib…
    Et comme LIBCMT.lib et MSVCRT.lib sont en conflit je sais pas trop quoi faire.
    Est ce qu on peut résoudre le conflit autrement qu en ignorant une des 2 lib ?

    J'ai ajouté libcp.lib dans le link au fait
    C'est bien ce truc la run time c++?


Discussions similaires

  1. Réponses: 46
    Dernier message: 29/07/2008, 14h24
  2. Problème de compilation avec visual express 2005
    Par BruceBoc dans le forum VC++ .NET
    Réponses: 7
    Dernier message: 27/03/2007, 19h16
  3. Compilation avec Visual C++ 2005 Express pour avoir un module python
    Par Freyja dans le forum Déploiement/Installation
    Réponses: 6
    Dernier message: 13/07/2006, 12h12
  4. configurer le sdk directx avec visual c# express 2005
    Par khodi03 dans le forum DirectX
    Réponses: 1
    Dernier message: 22/01/2006, 11h17
  5. Faire du telnet avec visual c++ express
    Par jean tof dans le forum MFC
    Réponses: 2
    Dernier message: 10/01/2006, 14h11

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