Ubuntu 18.04 install SDL2

Linux作業系統安裝、設定與管理 (CentOS、Ubuntu)
回覆文章
inho
文章: 60
註冊時間: 2017-12-08, 23:00

Ubuntu 18.04 install SDL2

文章 inho » 2018-10-10, 13:01

安裝】】SDL2 時,要特別注意:./configure 的附帶參數 --disable-pulseaudio ........
#==== for Raspberry Pi
$ ./configure --enable-video-opengles2 --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
#============ for ubuntu ???
./configure --enable-video-opengles2 --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
r
r
參考網站: https://choccyhobnob.com/raspberry-pi/s ... pberry-pi/
#install sdl2
sudo apt install libsdl2-dev libsdl2-2.0-0 -y;

#install sdl image
sudo apt install libjpeg9-dev libwebp-dev libtiff5-dev libsdl2-image-dev libsdl2-image-2.0-0 -y;

#install sdl mixer
sudo apt install libmikmod-dev libfishsound1-dev libsmpeg-dev liboggz2-dev libflac-dev libfluidsynth-dev libsdl2-mixer-dev libsdl2-mixer-2.0-0 -y;

#install sdl true type fonts
sudo apt install libfreetype6-dev libsdl2-ttf-dev libsdl2-ttf-2.0-0 -y;
#=======================================================================
./autogen.sh
./configure --disable-video-opengl
#### $ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-opengl
make
sudo make install
###
# 下載 】SDL 最新套件: SDL2, SDL2_image, SDL2_ttf, SDL2_net, SDL2_mixer,

$ wget
https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
https://www.libsdl.org/projects/SDL_ttf ... .15.tar.gz https://www.libsdl.org/projects/SDL_ima ... 0.4.tar.gz https://www.libsdl.org/projects/SDL_mix ... 0.4.tar.gz ## http://www.libsdl.org/projects/SDL_net/ ... 0.1.tar.gz
https://www.libsdl.org/projects/SDL_smp ... 0.0.tar.gz

#============ install SDL2 == ALSA: Advanced Linux Sound Architecture. ===
# 解決 SDL_OpenAudio: No such audio device 的問題
# to includes PulseAudio and ALSA support.
$ sudo apt-get install libasound2-dev libpulse-dev
# 解決 ERROR: Could not initialize SDL video
$ sudo apt-get install xorg-dev
# 解決 libavcodec/avcodec.h: No such file or directory
$ sudo apt-get install libavcodec-dev
# 解決 fatal error: libswscale/swscale.h: No such file or directory
$ sudo apt-get install libswscale-dev
# -lavformat -lavcodec -lswscale -lavutil
$ sudo apt-get install libavutil-dev
#=================================================
$ tar -zxvf SDL2-2.0.9.tar.gz
$ cd SDL2-2.0.9
$ ./configure
$ make
$ sudo make install
解壓縮:
#$ tar -zxvf SDL2-2.0.9.tar.gz
#$ cd SDL2-2.0.9
#$ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-opengl
#$ make
#$ sudo make install
#==============================================================
$ tar -zxvf SDL2_ttf-2.0.15.tar.gz
$ cd SDL2_ttf-2.0.15
$ sudo apt-get install libfreetype6 libfreetype6-dev
$ ./configure
## 如果沒有先 install libfreetype6 libfreetype6-dev 會出現以下 Error Message
## configure: error: *** Unable to find FreeType2 library (http://www.freetype.org/)

$ make
$ sudo make install

#================= install SDL2_image =============
# Install the libjpeg, libpng, libtiff and libgif packages, needed to convert between JPEG, PNG, TIFF, GIF # and WebP image formats.
$ tar -zxvf SDL2_image-2.0.4.tar.gz
# 安裝以前 先安裝 以下套件 ,否則會造成 不支援 PNG、JPG file
$ sudo apt-get install libwebp-dev libtiff-dev #// or
$ sudo apt-get install libtiff5-dev" #//===or
$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev # (suggested)
$ cd SDL2_image-2.0.4
$ ./configure
$ make
$ sudo make install

#==========================================
$ tar -zxvf SDL2_mixer-2.0.1.tar.gz
$ tar -zxvf SDL2_net-2.0.1.tar.gz
$ tar -zxvf SDL2_smpeg2-2.0.0.tar.gz

參考網站:http://forum.outpost2.net/index.php?topic=5978.0

ssref
系統管理員
文章: 6
註冊時間: 2017-12-05, 22:02

Re: Ubuntu 18.04 install SDL2

文章 ssref » 2019-05-22, 21:49

inho 寫:
2018-10-10, 13:01
安裝】】SDL2 時,要特別注意:./configure 的附帶參數 --disable-pulseaudio ........
#==== for Raspberry Pi
$ ./configure --enable-video-opengles2 --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl --host=arm-raspberry-linux-gnueabihf
#============ for ubuntu ???
./configure --enable-video-opengles2 --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl
r
r
參考網站: https://choccyhobnob.com/raspberry-pi/s ... pberry-pi/
#=======================================================================
./autogen.sh
./configure --disable-video-opengl
#### $ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-opengl
make
sudo make install
###
# 下載 】SDL 最新套件: SDL2, SDL2_image, SDL2_ttf, SDL2_net, SDL2_mixer,

$ wget
https://www.libsdl.org/release/SDL2-2.0.9.tar.gz https://www.libsdl.org/projects/SDL_ttf ... .14.tar.gz https://www.libsdl.org/projects/SDL_ima ... 0.4.tar.gz https://www.libsdl.org/projects/SDL_mix ... 0.1.tar.gz ## http://www.libsdl.org/projects/SDL_net/ ... 0.1.tar.gz
https://www.libsdl.org/projects/SDL_smp ... 0.0.tar.gz

#============ install SDL2 == ALSA: Advanced Linux Sound Architecture. ===
# 解決 SDL_OpenAudio: No such audio device 的問題
# to includes PulseAudio and ALSA support.
$ sudo apt-get install libasound2-dev libpulse-dev
解壓縮:
$ tar -zxvf SDL2-2.0.9.tar.gz
$ cd SDL2-2.0.9
$ ./configure --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-opengl
$ make
$ sudo make install
#==============================================================
$ tar -zxvf SDL2_ttf-2.0.14.tar.gz
$ cd SDL2_ttf-2.0.14
$ ./configure
$ make
$ sudo make install

#================= install SDL2_image =============
# Install the libjpeg, libpng, libtiff and libgif packages, needed to convert between JPEG, PNG, TIFF, GIF # and WebP image formats.
$ tar -zxvf SDL2_image-2.0.4.tar.gz
# 安裝以前 先安裝 以下套件 ,否則會造成 不支援 PNG、JPG file
$ sudo apt-get install libwebp-dev libtiff-dev #// or
$ sudo apt-get install libtiff5-dev" #//===or
$ sudo apt-get install libjpeg-dev libpng-dev libtiff-dev libgif-dev # (suggested)
$ cd SDL2_image-2.0.4
$ ./configure
$ make
$ sudo make install

#==========================================
$ tar -zxvf SDL2_mixer-2.0.1.tar.gz
$ tar -zxvf SDL2_net-2.0.1.tar.gz
$ tar -zxvf SDL2_smpeg2-2.0.0.tar.gz

參考網站:http://forum.outpost2.net/index.php?topic=5978.0

回覆文章