Visual c++ Express 2005 Beta 2, aidez moi !!!

Rom1FromMars Messages postés 3 Date d'inscription mardi 19 juillet 2005 Statut Membre Dernière intervention 23 juillet 2005 - 23 juil. 2005 à 18:00
cs_Arnotic Messages postés 933 Date d'inscription dimanche 1 avril 2001 Statut Membre Dernière intervention 9 janvier 2012 - 23 juil. 2005 à 23:03
Décidé à faire un peu d'infidélité à openGL je voulais me lancer à DirectX. Ayant lu d'ici et là qu'il valait mieux utiliser un compilateur Microsoft, je me suis dit allons télécharger le visual c++ gatuit, et là les ennuis commencent...

Tout d'abord Microsoft a eu la tres bonne idée de ne pas inclure la plateforme SDK windows pour compiler du code Win32. Pas de probleme je telecharge le gros pack. Là il semblerait qu'il n y ait aucune installation automatique... je copie donc les rep. Bin,Lib et Include du SDK vers ceux de visual c++.
La 2eme bonne surprise est le "bug" du menu : Tools/options/project and solutions/vc++ directories, impossible de selectionner quoi que se soit.

J' ai donc suivi le tutorial : http://blogs.msdn.com/brianjo/articles/422600.aspx
Je ne possede pas de fichier "vccomponents.dat" à supprimer. J'ai bien modifier les fichiers : corewin_express.vsprops et AppSettings.htm. Mais ça marche toujours pas

Toujours des problemes de linkage... voila mon code :


#include
"stdafx.h"


#include
<Windows.h>


//#include "ressource.h"


LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam);


int APIENTRY WinMain(HINSTANCE hInstance,


HINSTANCE hPrevInstance,


LPSTR lpCmdLine,



int nCmdShow)


{


HWND hDlg;


hDlg=CreateDialog(hInstance,(LPCTSTR)
"Test",NULL,(DLGPROC)MainProc);


ShowWindow(hDlg,SW_SHOW);


MSG msg;



while(GetMessage(&msg,NULL,0,0)==TRUE)


{


TranslateMessage(&msg);


DispatchMessage(&msg);


}



return 0;


}


LRESULT CALLBACK MainProc(HWND Dlg,UINT message,WPARAM wParam,LPARAM lParam)


{



int Select;



switch(message)


{



case WM_COMMAND:


Select=LOWORD(wParam);



switch(Select)


{



case IDOK:


EndDialog(Dlg,0);


PostQuitMessage(0);



return TRUE;



case IDCANCEL:


EndDialog(Dlg,Select);


PostQuitMessage(0);



return TRUE;


}



default:



return FALSE;


}


}


Et les problemes de linkage :

Compiling...


stdafx.cpp


Compiling...


Test4.cpp


Compiling manifest to resources...


Linking...


Test4.obj : error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _WinMain@16


Test4.obj : error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16


Test4.obj : error LNK2019: unresolved external symbol __imp__GetMessageW@16 referenced in function _WinMain@16


Test4.obj : error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function _WinMain@16


Test4.obj : error LNK2019: unresolved external symbol __imp__CreateDialogParamW@20 referenced in function _WinMain@16


Test4.obj : error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "long __stdcall MainProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainProc@@YGJPAUHWND__@@IIJ@Z)


Test4.obj : error LNK2019: unresolved external symbol __imp__EndDialog@8 referenced in function "long __stdcall MainProc(struct HWND__ *,unsigned int,unsigned int,long)" (?MainProc@@YGJPAUHWND__@@IIJ@Z)


MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup


Debug\Test4.exe : fatal error LNK1120: 8 unresolved externals


Build log was saved at "file://c:\Documents and Settings\Rom1\Mes documents\Visual Studio 2005\Projects\Test4\Test4\Debug\BuildLog.htm"


Test4 - 9 error(s), 0 warning(s)


======== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



AIDEZ MOI !
Merciiiiiiii

3 réponses

Rom1FromMars Messages postés 3 Date d'inscription mardi 19 juillet 2005 Statut Membre Dernière intervention 23 juillet 2005
23 juil. 2005 à 19:11
Bon progression :

Dans : Project/Properties.../Linker/Input, je mets : kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib $(NoInherit)

L'erreur de compilation devient alors :


------ Rebuild All started: Project: Test5, Configuration: Debug Win32 ------


Deleting intermediate and output files for project 'Test5', configuration 'Debug|Win32'


Compiling...


stdafx.cpp


Compiling...


Test5.cpp


c:\documents and settings\rom1\mes documents\visual studio 2005\projects\test5\test5\test5.cpp(73) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data


Compiling manifest to resources...


Linking...


MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function _mainCRTStartup


Debug\Test5.exe : fatal error LNK1120: 1 unresolved externals


Build log was saved at "file://c:\Documents and Settings\Rom1\Mes documents\Visual Studio 2005\Projects\Test5\Test5\Debug\BuildLog.htm"


Test5 - 2 error(s), 1 warning(s)


======== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

.......
0
Rom1FromMars Messages postés 3 Date d'inscription mardi 19 juillet 2005 Statut Membre Dernière intervention 23 juillet 2005
23 juil. 2005 à 19:30
C'est bon dernier problème résolu !!!

Si certains d'entres vous ont un problème similaire ils peuvent venir poster ici...
0
cs_Arnotic Messages postés 933 Date d'inscription dimanche 1 avril 2001 Statut Membre Dernière intervention 9 janvier 2012
23 juil. 2005 à 23:03
Les seuls problèmes viennent de toi. Tu n'avais pas inclus les bonnes libs, ...
Après il ne faut pas oublier que c'est une beta version (référence au bug menu).

@+
Arnotic,
Admin CS, MVP Visual C++
0
Rejoignez-nous