0
votes

I have a program I wrote in windows using the SDL library that I would like to compile for Raspbian. I installed CodeBlocks on the Raspbian and followed these instructions to set up SDL: http://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/codeblocks/

I get the following error: g++ -LC:/SDL/lib -o bin/Debug/SDL_menu obj/Debug/main.o obj/Debug/menu.o -lmingw32 -lSDL2main -lSDL2
obj/Debug/menu.o: file not recognized: File format not recognized collect2: error: ld returned 1 exit status

I later tried this tutorial (which actually matches the version of SDL I am using, although I used the previous tutorial to get it to work on Windows): http://lazyfoo.net/tutorials/SDL/01_hello_SDL/linux/codeblocks/index.php

And I get the error:

ld||cannot find -lSDL2|

I have very little experience with Raspbian or Linux which is probably why this is so difficult.

What can I do to get this set up?

1

1 Answers

0
votes

You need to install all SDL2-dev packages.

apt-get install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev

The include folder will probably be /usr/include/SDL2.

And by inspecting your build command, you're trying to pass Windows style path on a Unix machine, that doesn't end well for sure. Don't link with mingw32 if you're not using Mingw32 compiler, and you should only link against mingw32 on Windows as well.