Vous ne trouvez pas de réponse à votre problème ? Alors posez la question dans le forum. Souvenez-vous qu'il n'y a jamais de question bête, mais rester dans l'ignorance parce que l'on n'ose pas poser une question, ça c'est une erreur !

Sujet : Problème avec MFC [ Archives / Au secours ] (DeadlyPredator)

lundi 19 juillet 2004 à 03:22:14 | Problème avec MFC

DeadlyPredator

Salut,
Je souhaite compiler mon projet MFC en ligne de commande. Donc, j'ai créé la batch suivante :

md Lol
midl /I".\Include" /newtlb /tlb ".\Lol\mcFirstX.tlb" "mcFirstX.odl"
Cl /W3 /GX /O2 /I".\Include" /I".\MFC\Include" /Fo".\Lol\StdAfx.Obj" /Fd".\Lol\StdAfx.Pdb" /FD /c "StdAfx.cpp"
Cl /W3 /GX /O2 /I".\Include" /I".\MFC\Include" /Fo".\Lol\McFirstX.Obj" /Fd".\Lol\McFirstX.Pdb" /FD /c "McFirstX.cpp"
Cl /W3 /GX /O2 /I".\Include" /I".\MFC\Include" /Fo".\Lol\McFirstX.Obj" /Fd".\Lol\McFirstX.Pdb" /FD /c "McFirstX.cpp"
Cl /W3 /GX /O2 /I".\Include" /I".\MFC\Include" /Fo".\Lol\McFirstXCtl.Obj" /Fd".\Lol\McFirstXCtl.Pdb" /FD /c "McFirstXCtl.cpp"
Cl /W3 /GX /O2 /I".\Include" /I".\MFC\Include" /Fo".\Lol\McFirstXPpg.Obj" /Fd".\Lol\McFirstXPpg.Pdb" /FD /c "McFirstXPpg.cpp"
rc /r /fo".\Lol\Ressources.res" /I".\Include" /I".\Lol" /I".\MFC\Include" "mcFirstX.rc"
cvTres /OUT:".\Lol\Ressources.Obj" ".\Lol\Ressources.res"
Link "msvcrt.lib" /LIBPATH:".\MFC\Lib" /LIBPATH:".\Lib" /DEF:"mcFirstX.def" /IMPLIB:".\Lol\mcFirstX.lib" /OUT:".\Lol\MCFIRSTX.OCX" /DLL /INCREMENTAL:NO ".\Lol\McFirstX.obj" ".\Lol\McFirstXPpg.obj" ".\Lol\McFirstXCtl.obj" ".\Lol\StdAfx.obj" ".\Lol\Ressources.obj"


Et ça me donne l'erreur :
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

nafxcw.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in msvcrt.lib(MSVCRT.dll)
nafxcw.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcrt.lib(MSVCRT.dll)
libc.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)
libc.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)
nafxcw.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
nafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in msvcrt.lib(MSVCRT.dll); second definition ignored
libc.lib(crt0init.obj) : warning LNK4006: ___xc_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libc.lib(crt0init.obj) : warning LNK4006: ___xc_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libc.lib(crt0init.obj) : warning LNK4006: ___xi_z already defined in msvcrt.lib(cinitexe.obj); second definition ignored
libc.lib(crt0init.obj) : warning LNK4006: ___xi_a already defined in msvcrt.lib(cinitexe.obj); second definition ignored
Creating library .\Lol\mcFirstX.lib and object .\Lol\mcFirstX.exp
LINK : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
libc.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
.\Lol\MCFIRSTX.OCX : fatal error LNK1120: 1 unresolved externals

Et si j'enlève le "msvcrt.lib", :
Microsoft (R) Incremental Linker Version 6.00.8447
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

Creating library .\Lol\mcFirstX.lib and object .\Lol\mcFirstX.exp
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
.\Lol\MCFIRSTX.OCX : fatal error LNK1120: 2 unresolved externals
Alors que ces symbols ce trouvent dans msvcrt.lib

Que faire pour arranger ce problème?

Merci

VIVE LE QUÉBEC!
Essayez ça

Dim l As Long: Do Until l = -1: l = l + 1: Loop

p.s.Si vous l'avez essayé, vous êtes vraiment stupide

lundi 19 juillet 2004 à 03:46:27 | Re : Problème avec MFC

xarier

ben d'apres ce ke je vois dans code contient plsuieur erreur secondo
pour savoir compilre sous la line de command refer toi a la msdn
Life is Short

lundi 19 juillet 2004 à 05:30:04 | Re : Problème avec MFC

DeadlyPredator

Ben c'est que CL compile tout très bien mais le problème est dans le linkage. Pi MSDN n'a rien de bon à proposer là dessu (j'ai cherché)

Creating library .\Lol\mcFirstX.lib and object .\Lol\mcFirstX.exp
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcw.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
.\Lol\MCFIRSTX.OCX : fatal error LNK1120: 2 unresolved externals

^Ça veut dire qu'il faut que je link avec MSVCRT.LIB (multi-thread) MAIS ÇA DONNE PIRE QUAND JE L'AJOUTE!!!

lundi 19 juillet 2004 à 12:18:59 | Re : Problème avec MFC

xarier

salut j'ai peut pas t'aider pour le trucs de la line de command mais j'ai peut etre une petit solution
si tu utilise la line de commande parceque VCTOOLKIT2003 et free j'ai pour toi une superbre solution que je viend d'installer a l'instant (VISUAL C++ EXPRESS) c free !!!!aller j'eté un coup d'oeil ;)
Life is Short



Cette discussion est classé dans : obj, lol, lib, msvcrt, mcfirstx


Répondre à ce message

Sujets en rapport avec ce message

utiliser une librairie faite pour du C dans du C++??? [ par cartouh ] Bonjour,j'essaie d'utiliser la librairie CPDFLib (http://www.fastio.com/)je l'ai compilé sous visual comme ils disent dans la doc, j'obtient un .libje Problème de compilation [ par PunkDude424 ] Bonjour, j'ai un problème avec la compilation de projet sous visual studio 2003Mon problème est le suivant : J'ai téléchargé les librairies RTSP LiveM pb de librairie [ par didrocks ] J'ai un problème lors de la complication de mon app en mode debug (et seulement en mode debug) avec vc++ 6.0:nafxcwd.lib(afxmem.obj) : error LNK2001: Pb de choix de classe [ par abdoulax ] Bon voici mon probleme : #include class test; void appel(test * obj); class test {     public:         int a;     &nbs probleme lors utilise jrtplib sour Visual C++ 6, j'en peut plus!!! [ par maaxobelixyeye ] J'ai bien compilé la lib, et j'ai bien installé sp6, les sdk, bien indiqué le chemin de lib, src, mais vc++6 me dit : example2.obj : error LNK2001: u D'où vien l'erreur!!!? [ par mouminek ] Bonjour tout le monde, Je dois modifier dans un code ecrit en C++ dans VC++ 6.0. C'est un porogramme d'acquisition d'image utlisant un camera Apogee.. [VC++6\wxWidgets] Problème à l'installation de v2.6.1 [ par Sunsawe ] Bonjour à tous. Je cherche donc à installer la dernière version à ce jour de wxWidgets avec VC++. Pour cela je suis le guide indiqué ici [url=http://w probleme de link avec libpng [ par spiky31 ] bonjourca fait plusieurs heures que je me triture le cerveau afin de trouver une solution mais ca ne vient décidemment pas, alors je tente de poster m Probleme de librairie [ par KissyFroth ] J'ai un probleme avec une source que j'ai prise et que j'essaie vainement de compiler : Voilà l'erreur : nafxcwd.lib(afxmem.obj) : error LNK2005: "voi ODE : link errors à la compilation [ par Tibabou ] Bonjour,    Je souhaite utiliser ODE dans un programme. Malheureusement, la compilation pose problème (j'utilise Visual C++ 6 et je suis sous windows


Nos sponsors

Sondage...

CalendriCode

Juillet 2009
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
2728293031  

Consulter la suite du CalendriCode

Téléchargements

Logiciels à télécharger sur le même thème :

Comparez les prix Nouvelle version

Photothèque Nouveau !



Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés
Temps d'éxécution de la page : 0,499 sec

Google Coop CodeS-SourceS Google Coop CodeS-SourceS


Certaines images présentes sur le site (notament certains avatars) sont issues des collections IconShock, donc si vous souhaitez utiliser ces icons vous devez les acheter, ne les copiez pas et ne utilisez pas dans vos sites et applications sans les avoir commandé.