Author Topic: Compiling SDL for Windows (CodeBlocks) [Need Help]  (Read 638 times)

Offline The13thRonin

  • Zombie Food
  • *
  • Posts: 21
    • View Profile
Compiling SDL for Windows (CodeBlocks) [Need Help]
« on: October 11, 2016, 01:07:31 PM »
I am receiving the following errors when trying to compile.

||=== Build: Release (SDL) in Cataclysm (compiler: GNU GCC Compiler) ===|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_SetRenderDrawColor'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderFillRect'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_SetRenderDrawColor'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderDrawPoint'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_SetRenderTarget'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_SetRenderDrawColor'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderFillRect'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_SetRenderDrawColor'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderFillRect'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderClear'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_QueryTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_RenderCopyEx'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_CreateRGBSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_CreateTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| more undefined references to `SDL_DestroyTexture' follow|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `IMG_Load'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_DestroyTexture'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_FreeSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_CreateTextureFromSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_CreateTextureFromSurface'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_UpperBlit'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_GetError'|
obj\ReleaseSDL\src\cata_tiles.o:cata_tiles.cpp|| undefined reference to `SDL_CreateTextureFromSurface'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build failed: 50 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I have added the bundled libraries for CodeBlocks found here: http://dev.narc.ro/cataclysm/cdda-win64-codeblocks.7z to my Cataclysm source folder.

It seems that the program is not recognizing the SDL libraries but I don't know why.

Please help me, thank you!

Offline Maddremor

  • Zombie Food
  • *
  • Posts: 32
    • View Profile
Re: Compiling SDL for Windows (CodeBlocks) [Need Help]
« Reply #1 on: October 29, 2016, 11:25:10 PM »
I am experiencing the same issue.

Offline wad67

  • Survivor
  • ***
  • Posts: 358
    • View Profile
Re: Compiling SDL for Windows (CodeBlocks) [Need Help]
« Reply #2 on: November 28, 2016, 02:40:18 PM »
I can't quite recall, but you might have to link SDL to your toolchain in codeblocks.

It's about the same effort required to set up a dualboot with linux for the sole purpose of cross compiling back to windows.

Offline Zhilkin

  • NPC
  • **
  • Posts: 218
    • View Profile
Re: Compiling SDL for Windows (CodeBlocks) [Need Help]
« Reply #3 on: August 23, 2017, 08:25:36 AM »
You probably have wrongly mixed 32 and 64 bit versions of libraries/compiler.