sdl

SDL、SDL_image及SDL_ttf 交叉编译(mipsel) 已有 623 次阅读 2011-01-29 19:10 标签: 结构图 style home 交叉编译环境 Ubuntu 10.04 内核版本 2.6.32 交叉工具链为 mipsel-linux-gcc-3.3 目录结构图 |-opt |-home |-include |- cross |-bin |- SDL-1.2.13 |-lib |- SDL_image-1.2.10 |-share |- SDL_ttf-2.0.9 |- agar-1.3.4 |-Cross |- libpng-1.4.2 |-target |- freetype-2.4.3 |-local |- libiconv-1.13.1 |- expat-2.0.1 |- jpeg-7 |- zlib-1.2.5 6.编译SDL-1.2.13 软件名称 SDL-1.2.13 功能描述 SDL是一个自由的跨平台的多媒体开发包,适用视频音频和其他应用的软件 下载地址 http://www.libsdl.org/download-1.2.php 软件版本 SDL-1.2.13.tar.gz 依赖关系 默认 前置条件 源文件位置:$(work_dir)/SDL-1.2.13.tar.gz 添加环境变量 export PATH=/Cross/target/local/bin:$PATH # ./configure -–host=mipsel-linux -–prefix=/opt --build=i686-pc-linux –-disable-static \ –-disable-nasm –-disable-video-x11 –-disable-x11-shared –-disable-dga \ –-disable-video-dga –-disable-video-x11-dgamouse –-disable-video-x11-vm \ –-disable-video-x11-xv -–disable-video-x11-xinerama -–disable-video-x11-xme \ --disable-video-x11-xrander --disable-video-x11-dpms --disable-video-svga \ --enable-input-tslib --disable-esd --disable-esdtest --disable-esd-shared --without-x # make # make install 6.1SDL/test 范例编译 # ./configure --host=mipsel-linux --prefix=/opt --without-x; #make 提醒:若出现以下错误请修改Makefile文件 ngson/cross-sdl/lib/libSDL.so, not found (try using -rpath or -rpath-link) /home/loongson/cross-sdl/lib/libSDL.so: undefined reference to `libiconv_open' /home/loongson/cross-sdl/lib/libSDL.so: undefined reference to `libiconv_close' /home/loongson/cross-sdl/lib/libSDL.so: undefined reference to `libiconv' collect2: ld returned 1 exit status make: *** [checkkeys] Error 1 $ vim Makefile >CFLAGS = -Wl,--rpath-link -Wl,/opt/lib -I/opt/include -I/opt/include/SDL -D_GNU_SOURCE= 1 -D_REENTRANT -I/usr/include CFLAGS= -I/opt/include/SDL LIBS=-Wl,rpath,/opt/lib –L/opt/lib –LSDL -lpthread LIBPNG选项 添加成如下参数(默认为空): >LIBPNG_CFLAGS = -I/opt/include/libpng13 >LIBPNG_LIBS = -lpng14 >LIBS = -Wl,-rpath,/opt/lib/ -L/opt/lib -lSDL -lpthread SDL_CFLAGS、SDL_LIBS选项也修改成如下 >SDL_CFLAGS = -D_GUN_SOURCE=1 -D_REENTRANT -I/opt/include/SDL SDL_LIBS = -Wl,-rpath,/opt/lib -L/opt/lib -lSDL -lpthread CFLAGS = -g -O2 -I/opt/include/freetype2 -I/opt/include -I/opt/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -I/opt/include FREETYPE_CONFIG = /opt/bin/freetype-config LIBS = -L/opt/lib -lfreetype -L/opt/lib -Wl,-rpath,/opt/lib -lSDL -lpthread SDL_CFLAGS = -I/opt/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT SDL_CONFIG = /opt/bin/sdl-config SDL_LIBS = -L/opt/lib -Wl,-rpath,/opt/lib -lSDL,-lpthread

你可能感兴趣的:(sdl)