Motorola Development Community

Member Login

Quick Search



Development Hacking, development, scripts etc


Reply
  #1  
Old 08-03-2008
MotoFans MODR
 
Join Date: Jul 2008
Location: Poland
Posts: 113
Thanks: 5
Thanked 25 Times in 17 Posts
Unhappy [e6] How to compile SDL program

Hi. I've been trying to do it for past two days, no luck
I have the ezx-toolchain from this forum, I can already write QT/console program without any problem. What I want is compiling SDL "hello world", but no luck

I have the SDL libraries used for games (this forum -> moto gamers) and they work with these precompiled games. So I've installed SDL-devel, programs compiled but they don't work:
Code:
[pc] $ gcc test.c -o sdl -lSDL -I/usr/include/SDL -L/opt/dev-ezx/e6/lib
[phone] $ ./sdl: relocation error: /mmc/mmca1/games/lib/libSDL-1.2.so.0: undefined symbol: _ZN6QGList5clearEv
I also tried static:
Code:
[pc] $ gcc test.c -o sdl -lSDL -I/usr/include/SDL -L/opt/dev-ezx/e6/lib -lpthread -static
[phone] $ ./sdl
Segmentation fault
(without pthread it wasn't even compiling)
And many other..

Please, tell me, how to setup environment to compile SDL programs against these libs? What may be problem in my env? Maybe the header files mismatch? I couldn't find original used to compile these SDL libraries, so I installed newest...
Any ideas?
Reply With Quote
  #2  
Old 08-03-2008
Moto Fans SENR
 
Join Date: Jun 2007
Location: Buenos Aires
Posts: 615
Thanks: 19
Thanked 234 Times in 70 Posts
Default

Many russian such as Winand , etc are used to compile SDL.
Wait until they read this tread.

Droopy
__________________
In Argentina
Reply With Quote
  #3  
Old 08-03-2008
Lubomyr's Avatar
MotoFans XPRT
 
Join Date: Aug 2007
Location: Lviv, Ukraine
Posts: 303
Thanks: 85
Thanked 413 Times in 165 Posts
Send a message via ICQ to Lubomyr Send a message via Skype™ to Lubomyr
Default

100% working SDL-enviroment for
1)cygwin+a1200devezxsdk
2)linux+1200blackhawksdk

translated in english http://www.google.com/translate?langpair=ru|en&u=http://forum.motofan.ru/index.php?showtopic=145454&st=0

original in russian http://forum.motofan.ru/index.php?ac...0#entry1108914

with this sdl enviroment, ported by me many SDL-app like (scummvm, jooleem, openttd, nuclearchess, alienblaster...)

package include all config,libs,includes
* SDL (libSDL) (a1200 port by eug)
* SDL_image (libSDL_image) (a1200 port by eug)
* SDL_mixer (libSDL_mixer) (a1200 port by eug)
* SDL_net (libSDL_net) (a1200 port by eug)
* SDL_ttf (libSDL_ttf) (a1200 port by lubomyr)
* SDL_gfx (libSDL_gfx) (a1200 port by lubomyr)
* SDL_sound (libSDL_sound) (a1200 port by lubomyr)
* zlib (libz) (a1200 port by eug)
* jpeg (libjpeg) (a1200 port by eug)
* Vorbis (libvorbis) (a1200 port by eug)
* ncurses (ncurses) (a1200 port by eug)
* Tremor (libvorbisidec) (a1200 port by lubomyr)
* mikmod (libmikmod) (a1200 port by eug)
* freetype (libfreetype) (a1200 port by lubomyr)
* png (libpng) (a1200 port by eug)
* ogg (libogg) (a1200 port by eug)
* FLAC (libFLAC) (a1200 port by lubomyr)
* mad (libmad) (a1200 port by lubomyr)
* mpeg2dec (libmpeg2) (a1200 port by lubomyr)
* smpeg (libsmpeg) (a1200 port by eug)
* xml2 (libxml2) (a1200 port by lubomyr)

manual created by me

used info from
EZX Crosstool and SDK for Motorola EZX phones
http://keaglez.blogspot.com/2008/01/...blackhawk.html

Enjoy...

Last edited by Lubomyr; 08-26-2008 at 03:28 PM.
Reply With Quote
The Following 2 Users Say Thank You to Lubomyr For This Useful Post:
Halftux (12-29-2008), puppetshow (08-04-2008)
  #4  
Old 08-03-2008
MotoFans MODR
 
Join Date: Jul 2008
Location: Poland
Posts: 113
Thanks: 5
Thanked 25 Times in 17 Posts
Default

Thank you Lubomyr, downloading the 'games-env-cygwin', we'll see
Does it support ncurses, by any chance? I saw ncurses libs in the package I mentioned earlier (the one needed to run games like openttd)

If yes, then I'll be able to port nice jabber client - ekg2 Or bitlbee + irssi
Reply With Quote
  #5  
Old 08-04-2008
MotoFans MODR
 
Join Date: Jul 2008
Location: Poland
Posts: 113
Thanks: 5
Thanked 25 Times in 17 Posts
Default

Yeah, I managed to compile SDL program, and even ported Visual Boy Advance (which isn't working, phone is too slow I guess).
Now I have problem with ncurses-based program - after compiling, I try to run it and I get:
Code:
Error opening terminal: xterm.
(no matter what TERM type I'll set)
The Allegro libs (yeah, I'm trying all of them!) aren't working as well, this time dying while linking:
Code:
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_rgb_scale_5x35'
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_indexed_palette'
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_rgb_map'
collect2: ld returned 1 exit status
Do you know how to solve it?
Reply With Quote
  #6  
Old 08-04-2008
Lubomyr's Avatar
MotoFans XPRT
 
Join Date: Aug 2007
Location: Lviv, Ukraine
Posts: 303
Thanks: 85
Thanked 413 Times in 165 Posts
Send a message via ICQ to Lubomyr Send a message via Skype™ to Lubomyr
Default

i have same problem with ncurses
Error opening terminal: ansi.

and same problem with allegro
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_rgb_scale_5x35'
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_indexed_palette'
/usr/local/lib/liballeg-4.2.2.so: undefined reference to `_colorconv_rgb_map'
collect2: ld returned 1 exit status

i don't known how to solve this prob.

Last edited by Lubomyr; 08-04-2008 at 08:10 PM.
Reply With Quote
  #7  
Old 08-04-2008
MotoFans MODR
 
Join Date: Jul 2008
Location: Poland
Posts: 113
Thanks: 5
Thanked 25 Times in 17 Posts
Default

Ah, I found solution for ncurses.
Download this: http://evil.nomicon.pl/terminfo.tar.bz2
Code:
mkdir -pv /mmc/mmca1/.home/.terminfo
export HOME=/mmc/mmca1/.home/
Now extract the file you downloaded to the $HOME/.terminfo, so you'd get something like this:
Code:
# ls /mmc/mmca1/.home/.terminfo
E  a  c  d  h  l  m  p  r  s  v  w  x
POOF! Your ncurses work
This means I'm going to port irssi! And bitlbee! That is, FINALLY decent IM client for E6

Still working on allegro, though.
Reply With Quote
The Following 2 Users Say Thank You to puppetshow For This Useful Post:
droopyargentina (08-26-2008), Lubomyr (08-04-2008)
  #8  
Old 08-25-2008
MotoFans MODR
 
Join Date: Jul 2008
Location: Poland
Posts: 113
Thanks: 5
Thanked 25 Times in 17 Posts
Default

One more question, I can't find it anywhere: What are the SDL key definitions, for e.g. left, right, camera, carrier/custom keys etc? For E6 of course. I had this info somewhere, but apparently it's lost :/
Reply With Quote
  #9  
Old 08-26-2008
Lubomyr's Avatar
MotoFans XPRT
 
Join Date: Aug 2007
Location: Lviv, Ukraine
Posts: 303
Thanks: 85
Thanked 413 Times in 165 Posts
Send a message via ICQ to Lubomyr Send a message via Skype™ to Lubomyr
Default

SDL key definitions

SDL_QT_MODIFICATOR=1

Key_a1200/e6 = SDLKeyName = SDLKeyCode

Call (a1200/e6) = SDLK_SPACE = 32
HangUp (a1200/e6) = SDLK_ESCAPE = 27
Camera (a1200/e6) = SDLK_PAUSE = 19
Volume+ (a1200/e6) = SDLK_PLUS = 43
Volume- (a1200/e6) = SDLK_MINUS = 45
Fire (a1200/e6) = SDLK_RETURN = 13
Up (a1200/e6) = SDLK_RIGHT = 275
Down (a1200/e6) = SDLK_LEFT = 276
Right (a1200/e6) = SDLK_DOWN = 274
Left (a1200/e6) = SDLK_UP = 273
Forward (e6) = SDLK_q = 113
Pause (e6) = SDLK_p = 112
Back (e6) = SDLK_o = 111
und.Call (e6) = SDLK_r = 114

select key (between vol+ & vol-) (a1200) = MOD key
und.hangup (e6) = MOD key

mod+Call (a1200/e6) = SDLK_f = 102
mod+Hangup (a1200/e6) = SDLK_a = 97
mod+Camera (a1200/e6) = SDLK_e =101
mod+Volume+ (a1200/e6) = SDLK_c = 99
mod+Volume- (a1200/e6) = SDLK_d = 100
mod+Fire (a1200/e6) = SDLK_b = 98
mod+Up (a1200/e6) = SDLK_j = 106
mod+Down (a1200/e6) = SDLK_i = 105
mod+Right (a1200/e6) = SDLK_h = 104
mod+Left (a1200/e6) = SDLK_g = 103


SDL_QT_MODIFICATOR=0
MOD key = SDLK_TAB = 9
Reply With Quote
The Following User Says Thank You to Lubomyr For This Useful Post:
puppetshow (08-26-2008)
  #10  
Old 08-26-2008
Moto Fans SENR
 
Join Date: Jun 2007
Location: Buenos Aires
Posts: 615
Thanks: 19
Thanked 234 Times in 70 Posts
Default

Thanks for both of you.
Hope to see more SDL software and games!!
They run fast and nice.

Droopy
__________________
In Argentina
Reply With Quote
 
Reply

Tags
compile, compile sdl, program, sdl

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compile a program on A1200 mdt414 A1200 General Chat 0 06-24-2008 12:42 PM
SDL compiled. Can't run SDL apps riteshtonk Development 6 11-21-2007 02:06 PM
Cross Compile joaorodrigo A1200 General Chat 2 05-22-2007 12:07 AM
[A925] program closed..program:music...reason code:user.. ferio Symbian UIQ Symbian V7(A1000, M1000) 1 04-29-2006 03:21 PM
SDL libs Yuretz E680 General Chat 0 05-05-2005 04:10 PM

 
Advertisement

Partner Links





Web Analytics