http://andescore.blogspot.com/2010/02/sdlsimple-directmedia-layer.html
好他講的都對,但如果你在平台ADP-AG101上跑你就錯了!
就只有configure 不對
./configure --host=nds32le-linux --prefix=/usr/local/sdl --disable-shared --enable-static --disable-audio --disable-cdrom --disable-alsa --disable-esd --disable-arts --disable-nasm --disable-video-x11 --disable-video-dga --disable-video-fbcon --disable-video-qtopia --disable-video-dummy
如果你這樣編下去,那你就沒有半個video device了!
請把--disable-video-fbcon 砍掉
大概會長這樣
./configure --host=nds32le-linux --prefix=/I_am_gun \
--disable-shared --enable-static --disable-audio --disable-cdrom --enable-input-tslib\
--disable-alsa --disable-esd --disable-arts --disable-nasm --disable-video-x11 \
--disable-video-dga --disable-video-qtopia --disable-video-dummy
請先參考這篇把tslib灌起來,你才會有video device
http://andescore.blogspot.com/2009/06/embedded-linux-qt4-2tslib_02.html
好了,現在編譯SDL自帶範例 testalpha.c
nds32le-linux-g++ testalpha.c \
-L /lhome/B9715006/SDLlib/lib \ //這行是我sdl 程式庫路徑
-L /lhome/B9715006/Trolltech/lib/ \ //這行是tslib程式庫路徑
-I /lhome/B9715006/SDLlib/include \ //這行是sdl include路徑
-I /lhome/B9715006/Trolltech/include \ //這行是tslib include路徑
-lts -lSDL -lpthread -o talpha
大概打這樣就會過了,記得不要static因為tslib是動態連結的,靜態連結就會出現
./src/video/fbcon/SDL_fbevents.c:556: undefined reference to `ts_open'
./src/video/fbcon/SDL_fbevents.c:556: undefined reference to `ts_open'
./src/video/fbcon/SDL_fbevents.c:557: undefined reference to `ts_config'
./src/video/fbcon/SDL_fbevents.c:557: undefined reference to `ts_config'
./src/video/fbcon/SDL_fbevents.c:562: undefined reference to `ts_fd'
./src/video/fbcon/SDL_fbevents.c:562: undefined reference to `ts_fd'
./src/video/fbcon/SDL_fbevents.c:556: undefined reference to `ts_open'
./src/video/fbcon/SDL_fbevents.c:556: undefined reference to `ts_open'
這樣的錯誤。
之後就porting到版子啦!
然後執行時記得
SDL的必須指定MOUSE device 使用tslib 下命令設SDL使用tslib.
看!
雖然有圖有真相不過等我把完整的wiki做好再說吧~
另外的參考:http://nckuhuahua.pixnet.net/blog/post/30066956
http://hi.baidu.com/qq520131714/blog/item/f39f80a1f9fd4d87461064f3.html
留言列表