I tied install sdl, I don't think it worked. Is there any way to put it in a folder in the same location as the .cpp file, so i can use it as:topguy wrote:Choosing a "game engine" or at least a "graphics engine" that you can work with is a good start. Then you can search for guides related specifically to those tools.
SDL (http://www.libsdl.org/) is probably the most widely used/known engine that has good multiplatform support and there should be plentyful of tutorials and example code out there. ( http://www.sdltutorials.com/ )
Code: Select all
sudo apt-get install libsdl1.2-devIs there some way that, instead of installing SDL, I can put it in the same folder as the .cpp file, so I can #include it like this?topguy wrote:When you say "install" what exactly did you do ?
This is what you should have done:NOTE: there are two versions of SDL available( 1.2 and 2.0 ), if you installed libsdl2-dev instead I guess the header files is "SDL2/*.h"Code: Select all
sudo apt-get install libsdl1.2-dev
Yes, but it would be much work and totally unnecessary, and if you ever wanted to test some code written by other persons you whould have to edit their files or at least their makefiles.mrpi64 wrote: Is there some way that, instead of installing SDL, I can put it in the same folder as the .cpp file, so I can #include it like this?
#include "SDL/SDL_FILE"
Did you download this code from somewhere ? Where ? Did it come with a Makefile or similar its these things that set up the compiler parameters correctly. Did it come with some compiling/installing instructions ?mrpi64 wrote:When I try to compile a 2d platformer source for the Pi, to see if SDL works, I get this error message when I use the command 'c++ Main.cpp -o rpi-game' (the file I try to compile is called Main.cpp):
Code: Select all
c++ Main.cpp -o rpi-game -lSDLThanks. I guess that if I could import the thing directly from usr/include/sdltopguy wrote:I find it strange if any official example didnt include instructions on how to link with the library.
.. should work according to this: http://lazyfoo.net/SDL_tutorials/lesson ... /index.phpCode: Select all
c++ Main.cpp -o rpi-game -lSDL