Bonjour
En reprenant mon projet un peu abandonné, j'ai eu la mauvaise surprise de voir ma licence Visual Studio expirer. Du coup, j'ai dû tout migrer vers CodeBlocks. Après avoir configuré correctement le projet en suivant les instructions à lettre, eu quelques problèmes et modifications à faire, je suis tombé sur ça :
En cherchant sur Google, je suis tombé sur 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
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 lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x56): undefined reference to `_imp__timeBeginPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x69): undefined reference to `_imp__timeEndPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0xe0): undefined reference to `_imp__timeBeginPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0xe9): undefined reference to `_imp__timeGetTime@0' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x116): undefined reference to `_imp__timeEndPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x185): undefined reference to `_imp__timeEndPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x1cd): undefined reference to `_imp__timeGetTime@0' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x27f): undefined reference to `_imp__timeBeginPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x288): undefined reference to `_imp__timeGetTime@0' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x2d6): undefined reference to `_imp__timeEndPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x324): undefined reference to `_imp__timeGetTime@0' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x3d1): undefined reference to `_imp__timeBeginPeriod@4' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x3da): undefined reference to `_imp__timeGetTime@0' lib\libSDL2.a(SDL_systimer.o):SDL_systimer.c:(.text+0x424): undefined reference to `_imp__timeEndPeriod@4' lib\libSDL2.a(SDL_windows.o):SDL_windows.c:(.text+0xe9): undefined reference to `_imp__CoInitializeEx@8' lib\libSDL2.a(SDL_windows.o):SDL_windows.c:(.text+0x141): undefined reference to `_imp__CoUninitialize@0' lib\libSDL2.a(SDL_windowsmouse.o):SDL_windowsmouse.c:(.text+0x2f8): undefined reference to `_imp__CreateDIBSection@24' lib\libSDL2.a(SDL_windowsmouse.o):SDL_windowsmouse.c:(.text+0x325): undefined reference to `_imp__CreateBitmap@20' lib\libSDL2.a(SDL_windowsmouse.o):SDL_windowsmouse.c:(.text+0x37c): undefined reference to `_imp__DeleteObject@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x5e): undefined reference to `ImmGetIMEFileNameA@12' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xae): undefined reference to `ImmGetContext@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xda): undefined reference to `ImmReleaseContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x302): undefined reference to `ImmGetIMEFileNameA@12' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x4b6): undefined reference to `GetFileVersionInfoSizeA@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x50b): undefined reference to `GetFileVersionInfoA@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x561): undefined reference to `VerQueryValueA@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x8ef): undefined reference to `_imp__SysFreeString@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x9f4): undefined reference to `ImmGetContext@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xa21): undefined reference to `ImmNotifyIME@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xa52): undefined reference to `ImmNotifyIME@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xa64): undefined reference to `ImmReleaseContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xb13): undefined reference to `ImmAssociateContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xb4c): undefined reference to `ImmSetCompositionStringW@24' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xc82): undefined reference to `ImmGetContext@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xcaf): undefined reference to `ImmNotifyIME@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xce0): undefined reference to `ImmNotifyIME@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xcf2): undefined reference to `ImmReleaseContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xd8c): undefined reference to `ImmSetCompositionStringW@24' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xe71): undefined reference to `_imp__SysFreeString@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0xfd9): undefined reference to `_imp__SysFreeString@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1278): undefined reference to `_imp__CoCreateInstance@20' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1353): undefined reference to `ImmGetContext@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1365): undefined reference to `ImmReleaseContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1406): undefined reference to `_imp__CoCreateInstance@20' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x16fc): undefined reference to `ImmGetIMEFileNameA@12' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1883): undefined reference to `GetFileVersionInfoSizeA@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x18d2): undefined reference to `GetFileVersionInfoA@16' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x193d): undefined reference to `ImmGetContext@4' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1a0c): undefined reference to `ImmReleaseContext@8' lib\libSDL2.a(SDL_windowskeyboard.o):SDL_windowskeyboard.c:(.text+0x1a4e): undefined reference to `VerQueryValueA@16'
Sauf que j'ai bien mis les includes et libs 32 bits. Du coup, qu'est ce que ça peut être ?Une erreur commune, provoquant l'apparition d'« undefined reference » malgré la bonne configuration du projet, est d'utiliser des bibliothèques 64 bits alors que le compilateur ne supporte que le 32 bits. En effet, certains compilateurs ne sont pas capables de gérer les formats 64 bits et donc ne les liront simplement pas (et ce bien que vous ayez un système d'exploitation 64 bits). Comme les fichiers de la bibliothèque ne sont pas lus, les fonctions définies dans le fichier ne seront pas reconnues, provoquant des erreurs de type « undefined reference ».
Partager