Bonjour !
Je tente depuis quelques jours d'installer SDL 2.0 à Visual Express C++ 2015 en suivant ce cours très complet --> http://alexandre-laurent.developpez....tion/#LIII-C-3
Voici le code de base :
Et voici les nombreuses erreurs que j'ai :
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54 //Using SDL and standard IO #include <SDL.h> #include <stdio.h> //Screen dimension constants const int SCREEN_WIDTH = 640; const int SCREEN_HEIGHT = 480; int main(int argc, char* args[]) { //The window we'll be rendering to SDL_Window* window = NULL; //The surface contained by the window SDL_Surface* screenSurface = NULL; //Initialize SDL if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("SDL could not initialize! SDL_Error: %s\n", SDL_GetError()); } else { //Create window window = SDL_CreateWindow("SDL Tutorial", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN); if (window == NULL) { printf("Window could not be created! SDL_Error: %s\n", SDL_GetError()); } else { //Get window surface screenSurface = SDL_GetWindowSurface(window); //Fill the surface white SDL_FillRect(screenSurface, NULL, SDL_MapRGB(screenSurface->format, 0xFF, 0xFF, 0xFF)); //Update the surface SDL_UpdateWindowSurface(window); //Wait two seconds SDL_Delay(2000); } } //Destroy window SDL_DestroyWindow(window); //Quit SDL subsystems SDL_Quit(); return 0; }
Je précise que j'ai configuré le projet en ajoutant les bibliothèques dépendantes.
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 La génération a démarré 15/09/2015 09:00:39. 1>Projet "C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\FirstTry.vcxproj" sur le nud 2 (Build cible(s)). 1>ClCompile: C:\Program Files\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /ZI /nologo /W4 /WX- /sdl /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc140.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp main.cpp 1>c:\users\admin\google drive\langages programmations\c++\projects sdl2\src\firsttry\main.cpp(12): warning C4100: 'args'*: paramètre formel non référencé 1>c:\users\admin\google drive\langages programmations\c++\projects sdl2\src\firsttry\main.cpp(12): warning C4100: 'argc'*: paramètre formel non référencé Link: C:\Program Files\Microsoft Visual Studio 14.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\Debug\FirstTry.exe" /INCREMENTAL /NOLOGO "C:/Users/Admin/Google Drive/Langages programmations/C++/Projects SDL2/lib/SDL2main.lib" "C:/Users/Admin/Google Drive/Langages programmations/C++/Projects SDL2/lib/SDL2.lib" kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /NODEFAULTLIB:MSVCRTD.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /Debug /PDB:"C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\Debug\FirstTry.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\Debug\FirstTry.lib" /MACHINE:X86 Debug\main.obj 1>main.obj : error LNK2019: symbole externe non résolu __imp____acrt_iob_func référencé dans la fonction _printf 1>main.obj : error LNK2019: symbole externe non résolu __imp____stdio_common_vfprintf référencé dans la fonction __vfprintf_l 1>main.obj : error LNK2019: symbole externe non résolu __RTC_CheckEsp référencé dans la fonction _SDL_main 1>main.obj : error LNK2001: symbole externe non résolu __RTC_InitBase 1>main.obj : error LNK2001: symbole externe non résolu __RTC_Shutdown 1>LINK : error LNK2001: symbole externe non résolu _WinMainCRTStartup 1>C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\Debug\FirstTry.exe : fatal error LNK1120: 6 externes non résolus 1>Génération du projet "C:\Users\Admin\Google Drive\Langages programmations\C++\Projects SDL2\src\FirstTry\FirstTry.vcxproj" terminée (Build cible(s)) -- ÉCHEC. ÉCHEC de la build. Temps écoulé 00:00:00.94
Si j'ai oublié un élément à vous communiquer, dites-le moi et je l'ajouterais avec plaisir.
Je vous remercie d'avance pour votre aide et j'espère que je ne refais pas la même erreur que la dernière fois...
Cordialement,
Akiro.
Partager