The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
sdl2 && rsapberry
Scap_Pato


Joined: 10 May 2014
Posts: 11
Location: Italy
please help me
raspberry p2 and SDL2

before i've installed
(advice in ttps://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/)

sudo apt-get install build-essential
libfreeimage-dev libopenal-dev libpango1.0-dev
libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev
libtiff5-dev libwebp-dev automake

i've got SDL2-2.0.3.tar.gz
tar
cd SDL2-2.0.3 && mkdir build && cd build
../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
make
sudo make install
all above is ok
sudo ldconfig

now start my simple test.c

#include <SDL2/SDL.H>
#include <stdio.h>
#include <stdlib.h>

int main (){

if (SDL_Init(SDL_INIT_EVERYTHING) !=0) {
printf(
"\nUnable to initialize SDL: %s\n",
SDL_GetError()
);
return 1;
}
SDL_Delay(1000);

SDL_Quit();
return 0;
}

compile
gcc -Wall -o test test.c -lSDL2
or if you want is the same
gcc -Wall -o test test.c `sdl2-config --cflags --libs`

compile with no error

//execute
./test

Unable to initialize SDL:no available video device

is the same with
sudo ./test

or if start

with sudo startx ./test

please someone once for all could explain to a idiot child like me
how compile SDL2 for use in raspberry
with OpenGL ES and X server

i'm very frustrating
and hope someone clear my mind after days of compile and recompile
with same effect
best regards
luigi
(forgive my bad English)
sdl2 && rsapberry
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
You should give the binaries Buildbot generates a try...For example: https://buildbot.libsdl.org/sdl-builds/sdl-raspberrypi/sdl-raspberrypi-825.tar.xz (just uncompress to /)


2015-02-11 15:14 GMT-03:00 Scap_Pato:
Quote:
please help me
raspberry p2 and SDL2

before i've installed
(advice in ttps://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/)

sudo apt-get install build-essential
libfreeimage-dev libopenal-dev libpango1.0-dev
libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev
libtiff5-dev libwebp-dev automake

i've got SDL2-2.0.3.tar.gz
tar
cd SDL2-2.0.3 && mkdir build && cd build
../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
make
sudo make install
all above is ok
sudo ldconfig

now start my simple test.c

#include
#include
#include

int main (){

if (SDL_Init(SDL_INIT_EVERYTHING) !=0) {
printf(
"\nUnable to initialize SDL: %s\n",
SDL_GetError()
);
return 1;
}
SDL_Delay(1000);

SDL_Quit();
return 0;
}

compile
gcc -Wall -o test test.c -lSDL2
or if you want is the same
gcc -Wall -o test test.c `sdl2-config --cflags --libs`

compile with no error

//execute
./test

Unable to initialize SDL:no available video device

is the same with
sudo ./test

or if start

with sudo startx ./test

please someone once for all could explain to a idiot child like me
how compile SDL2 for use in raspberry
with OpenGL ES and X server

i'm very frustrating
and hope someone clear my mind after days of compile and recompile
with same effect
best regards
luigi
(forgive my bad English)


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org





--
Gabriel.
Scap_Pato


Joined: 10 May 2014
Posts: 11
Location: Italy
thanks Gabriel for your reply
i will do your advice this night (for me)
just tar .tar.xz file in a root?
please could you explain me why my compilation fail to run if all
is done in a right way?
i've already run sdl2 with x server bat is very slow
i'hope this way is faster than previous
best regards
drhelius


Joined: 19 Feb 2015
Posts: 2
Hi, I'm getting the same exact problem. Did you manage to fix it?
It seems it's not possible to init video on Rapsberry Pi 2.
Scap_Pato


Joined: 10 May 2014
Posts: 11
Location: Italy
http://askubuntu.com/questions/344512/what-is-the-general-procedure-to-install-development-libraries-in-ubuntu
http://www.raspberrypi.org/forums/viewtopic.php?t=56756&p=430647
https://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/


yes and no.
i'll try to explain
after a lot of trial, compile and recompile with advice above,
i was down.
the issue , i guess, were in dependencies installed and in configure
setting wrong .
i've followed all the advice above before used with success with b+ but with pi 2 doesn't .
no one ,also in raspberry forum enlightened me.
so it's better to get a precompiled build from
https://buildbot.libsdl.org/sdl-builds/sdl-raspberrypi/?C=M;O=D
unpack in root but be carefull because it overwrites previous installation and makes a mess
it works but i don't understand why i cannot build on my own sdl2 library with my raspberry pi 2.
i hope this help you.
sdl2 && rsapberry
MrOzBarry


Joined: 26 Jun 2010
Posts: 620
I will be compiling SDL2 for raspberry pi2 this weekend, so if you aren't having any success still, I'll report my findings. On 26 Feb 2015 02:58, "Scap_Pato" wrote:
Quote:
http://askubuntu.com/questions/344512/what-is-the-general-procedure-to-install-development-libraries-in-ubuntu
http://www.raspberrypi.org/forums/viewtopic.php?t=56756&p=430647
https://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/


yes and no.
i'll try to explain
after a lot of trial, compile and recompile with advice above,
i was down.
the issue , i guess, were in dependencies installed and in configure
setting wrong .
i've followed all the advice above before used with success with b+ but with pi 2 doesn't .
no one ,also in raspberry forum enlightened me.
so it's better to get a precompiled build from
https://buildbot.libsdl.org/sdl-builds/sdl-raspberrypi/?C=M;O=D
unpack in root but be carefull because it overwrites previous installation and makes a mess
it works but i don't understand why i cannot build on my own sdl2 library with my raspberry pi 2.
i hope this help you.


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

sdl2 && rsapberry
Steffen Hein
Guest

Try adding --host=arm-raspberry-linux-gnueabihf when calling the configure script. Otherwise it won't recognize the Pi2 correctly (and hence not enable the RPI video driver).



Quote:
Am 11.02.2015 um 19:14 schrieb Scap_Pato:

please help me
raspberry p2 and SDL2

before i've installed
(advice in ttps://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/)

sudo apt-get install build-essential
libfreeimage-dev libopenal-dev libpango1.0-dev
libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev
libtiff5-dev libwebp-dev automake

i've got SDL2-2.0.3.tar.gz
tar
cd SDL2-2.0.3 && mkdir build && cd build
../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
make
sudo make install
all above is ok
sudo ldconfig

now start my simple test.c

#include
#include
#include

int main (){

if (SDL_Init(SDL_INIT_EVERYTHING) !=0) {
printf(
"\nUnable to initialize SDL: %s\n",
SDL_GetError()
);
return 1;
}
SDL_Delay(1000);

SDL_Quit();
return 0;
}

compile
gcc -Wall -o test test.c -lSDL2
or if you want is the same
gcc -Wall -o test test.c `sdl2-config --cflags --libs`

compile with no error

//execute
./test

Unable to initialize SDL:no available video device

is the same with
sudo ./test

or if start

with sudo startx ./test

please someone once for all could explain to a idiot child like me
how compile SDL2 for use in raspberry
with OpenGL ES and X server

i'm very frustrating
and hope someone clear my mind after days of compile and recompile
with same effect
best regards
luigi
(forgive my bad English)
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Re: sdl2 && rsapberry
Scap_Pato


Joined: 10 May 2014
Posts: 11
Location: Italy
[quote="Steffen Hein"]Try adding --host=arm-raspberry-linux-gnueabihf when calling the configure script. Otherwise it won't recognize the Pi2 correctly (and hence not enable the RPI video driver).

Thanks a lot .
works!
drhelius


Joined: 19 Feb 2015
Posts: 2
Yes that did the trick.

In the end that is what I used for compiling SDL 2 in Raspberry Pi 2:

Code:

sudo apt-get update
sudo apt-get upgrade
sudo rpi-update
sudo apt-get install build-essential libfreeimage-dev libopenal-dev libpango1.0-dev libsndfile-dev libudev-dev libasound2-dev libjpeg8-dev libtiff5-dev libwebp-dev automake
cd ~
wget https://www.libsdl.org/release/SDL2-2.0.3.tar.gz
tar zxvf SDL2-2.0.3.tar.gz
cd SDL2-2.0.3 && mkdir build && cd build
../configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl --host=armv7l-raspberry-linux-gnueabihf
make -j 4
sudo make install