OESF Portables Forum

Everything Else => Zaurus - Everything Development => Distros, Development, and Model Specific Forums => Archived Forums => Linux Applications => Topic started by: Fromwithin on May 31, 2004, 10:47:02 am

Title: SDL compile trouble
Post by: Fromwithin on May 31, 2004, 10:47:02 am
I can now compile fbzx, the spectrum emulator. It runs, but the screen is messed up. So that I can test the result of various SDL settings to try to fix it, I\'ve written a tiny test SDL program that should initialize SDL, open an SDL screen, then shut down.

The test uses the same command sequence as fbzx, uses the same parameters, and links to the same libraries. But if I try to run it, I get \"QPaintDevice: Must construct a QApplication before a QPaintDeivce\".

I can\'t see why it\'s doing that because fbzx actually runs and opens a screen.

Anybody know what\'s going on?

I\'m using SDL1.2.6 libraries from zports (http://zports.sourceforget.net) with the SDL1.2.6 SDK files from gnurou.org (http://www.gnurou.org/software/zaurus/).
Title: SDL compile trouble
Post by: blakeyez on June 10, 2004, 04:53:41 pm
Hi there

I\'ve been working on compiling stuff for my friend\'s Zaurus (mine\'s coming next week!).  The problem you\'re experiencing means that you are not linking against SDLmain.  Use -lSDLmain before -lSDL in your linking command and that should fix it.
Title: SDL compile trouble
Post by: Fromwithin on June 11, 2004, 07:08:31 am
I managed to sort it out. I was previously linking with SDLMain, but there are some extra lines of code you have to put near the user main function as specified in the SDL docs.

Thanks though.
Title: SDL compile trouble
Post by: _Psycho on June 11, 2004, 07:50:37 am
You can also put SDL_main() in your code instead of main(), I believe that usually work
(Or maybe you have to).
Title: SDL compile trouble
Post by: blakeyez on June 12, 2004, 10:38:17 am
You shouldn\'t have to put SDL_main(), since the SDLmain.a library contains a macro that will rename your main() function to SDL_main() automatically, then has its own main() function that calls SDL_main() after initialization.  

Dave