Hi,
I have been using CodeBlocks with the GP2X dev kit for several weeks now. Game is coming along nicely, but I need to cross compile for Windows to aid testing and development.
I have downloaded:-
SDL 1.2.11
SDL_image 1.2.5
SDL_mixer 1.2.7
SDL_ttf 2.0.8
I have the includes all set correctly I believe as I get no compilation errors now. I have also used compiler directives to comment out any non GP2X related code.
The problem I have now is linking... What am I missing here? There error shown is:-
Switching to target: default
Compiling: shell.cpp
Linking executable: C:\devkitGP2X\projects\Invaders\Invaders.exe
C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lSDL_gfx
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
cannot find -lSDL_gfx
This leads me to think it cannot find the library for SDL_gfx? Is that part of the standard SDL?
If I remove the linker options (from the GP2X project settings), I get this:-
Linking executable: C:\devkitGP2X\projects\Invaders\Invaders.exe
.objs\shell.o:shell.cpp.text+0x1e9): undefined reference to `TTF_OpenFont'
.objs\shell.o:shell.cpp.text+0x1fe): undefined reference to `TTF_OpenFont'
.objs\shell.o:shell.cpp.text+0x273): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x2d4): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x3ab): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x40c): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x51e): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x52b): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x538): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x545): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x552): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x55f): more undefined references to `Mix_FreeChunk' follow
.objs\shell.o:shell.cpp.text+0x56c): undefined reference to `Mix_FreeMusic'
.objs\shell.o:shell.cpp.text+0x579): undefined reference to `Mix_FreeMusic'
.objs\shell.o:shell.cpp.text+0x57e): undefined reference to `Mix_CloseAudio'
.objs\shell.o:shell.cpp.text+0x58b): undefined reference to `TTF_CloseFont'
.objs\shell.o:shell.cpp.text+0x598): undefined reference to `TTF_CloseFont'
.objs\shell.o:shell.cpp.text+0x59d): undefined reference to `TTF_Quit'
.objs\shell.o:shell.cpp.text+0xbc0): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0xbcd): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0xc06): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0xc13): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0x1015): undefined reference to `IMG_Load'
.objs\shell.o:shell.cpp.text+0x112c): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x1145): undefined reference to `Mix_SetPanning'
.objs\shell.o:shell.cpp.text+0x18e6): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x2313): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x2f2b): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x31da): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x341b): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3452): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3468): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x366d): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3683): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x37ea): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x415e): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x47f8): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x4823): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x484e): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x4879): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x48a4): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x48cf): more undefined references to `Mix_LoadWAV_RW' follow
.objs\shell.o:shell.cpp.text+0x48e0): undefined reference to `Mix_LoadMUS'
.objs\shell.o:shell.cpp.text+0x48f1): undefined reference to `Mix_LoadMUS'
.objs\shell.o:shell.cpp.text+0x4be7): undefined reference to `TTF_Init'
.objs\shell.o:shell.cpp.text+0x4c0e): undefined reference to `Mix_OpenAudio'
.objs\shell.o:shell.cpp.text+0x4cae): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0x4cbb): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0x4cd1): undefined reference to `Mix_PlayMusic'
C:\Program Files\CodeBlocks\lib/libmingw32.a(main.o):main.c.text+0x106): undefined reference to `WinMain@16'
I have been using CodeBlocks with the GP2X dev kit for several weeks now. Game is coming along nicely, but I need to cross compile for Windows to aid testing and development.
I have downloaded:-
SDL 1.2.11
SDL_image 1.2.5
SDL_mixer 1.2.7
SDL_ttf 2.0.8
I have the includes all set correctly I believe as I get no compilation errors now. I have also used compiler directives to comment out any non GP2X related code.
The problem I have now is linking... What am I missing here? There error shown is:-
Switching to target: default
Compiling: shell.cpp
Linking executable: C:\devkitGP2X\projects\Invaders\Invaders.exe
C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: cannot find -lSDL_gfx
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
1 errors, 0 warnings
cannot find -lSDL_gfx
This leads me to think it cannot find the library for SDL_gfx? Is that part of the standard SDL?
If I remove the linker options (from the GP2X project settings), I get this:-
Linking executable: C:\devkitGP2X\projects\Invaders\Invaders.exe
.objs\shell.o:shell.cpp.text+0x1e9): undefined reference to `TTF_OpenFont'
.objs\shell.o:shell.cpp.text+0x1fe): undefined reference to `TTF_OpenFont'
.objs\shell.o:shell.cpp.text+0x273): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x2d4): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x3ab): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x40c): undefined reference to `TTF_RenderText_Blended'
.objs\shell.o:shell.cpp.text+0x51e): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x52b): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x538): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x545): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x552): undefined reference to `Mix_FreeChunk'
.objs\shell.o:shell.cpp.text+0x55f): more undefined references to `Mix_FreeChunk' follow
.objs\shell.o:shell.cpp.text+0x56c): undefined reference to `Mix_FreeMusic'
.objs\shell.o:shell.cpp.text+0x579): undefined reference to `Mix_FreeMusic'
.objs\shell.o:shell.cpp.text+0x57e): undefined reference to `Mix_CloseAudio'
.objs\shell.o:shell.cpp.text+0x58b): undefined reference to `TTF_CloseFont'
.objs\shell.o:shell.cpp.text+0x598): undefined reference to `TTF_CloseFont'
.objs\shell.o:shell.cpp.text+0x59d): undefined reference to `TTF_Quit'
.objs\shell.o:shell.cpp.text+0xbc0): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0xbcd): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0xc06): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0xc13): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0x1015): undefined reference to `IMG_Load'
.objs\shell.o:shell.cpp.text+0x112c): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x1145): undefined reference to `Mix_SetPanning'
.objs\shell.o:shell.cpp.text+0x18e6): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x2313): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x2f2b): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x31da): undefined reference to `Mix_PlayChannelTimed'
.objs\shell.o:shell.cpp.text+0x341b): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3452): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3468): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x366d): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x3683): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x37ea): undefined reference to `Mix_PlayMusic'
.objs\shell.o:shell.cpp.text+0x415e): undefined reference to `Mix_HaltMusic'
.objs\shell.o:shell.cpp.text+0x47f8): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x4823): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x484e): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x4879): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x48a4): undefined reference to `Mix_LoadWAV_RW'
.objs\shell.o:shell.cpp.text+0x48cf): more undefined references to `Mix_LoadWAV_RW' follow
.objs\shell.o:shell.cpp.text+0x48e0): undefined reference to `Mix_LoadMUS'
.objs\shell.o:shell.cpp.text+0x48f1): undefined reference to `Mix_LoadMUS'
.objs\shell.o:shell.cpp.text+0x4be7): undefined reference to `TTF_Init'
.objs\shell.o:shell.cpp.text+0x4c0e): undefined reference to `Mix_OpenAudio'
.objs\shell.o:shell.cpp.text+0x4cae): undefined reference to `Mix_Volume'
.objs\shell.o:shell.cpp.text+0x4cbb): undefined reference to `Mix_VolumeMusic'
.objs\shell.o:shell.cpp.text+0x4cd1): undefined reference to `Mix_PlayMusic'
C:\Program Files\CodeBlocks\lib/libmingw32.a(main.o):main.c.text+0x106): undefined reference to `WinMain@16'