OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> SDL compile trouble
Fromwithin
post May 31 2004, 06:47 AM
Post #1





Group: Members
Posts: 59
Joined: 17-February 04
From: Wirral, UK
Member No.: 1,907



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 with the SDL1.2.6 SDK files from gnurou.org.
Go to the top of the page
 
+Quote Post
blakeyez
post Jun 10 2004, 12:53 PM
Post #2





Group: Members
Posts: 90
Joined: 5-June 04
Member No.: 3,580



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.
Go to the top of the page
 
+Quote Post
Fromwithin
post Jun 11 2004, 03:08 AM
Post #3





Group: Members
Posts: 59
Joined: 17-February 04
From: Wirral, UK
Member No.: 1,907



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.
Go to the top of the page
 
+Quote Post
_Psycho
post Jun 11 2004, 03:50 AM
Post #4





Group: Members
Posts: 114
Joined: 7-December 03
Member No.: 1,057



You can also put SDL_main() in your code instead of main(), I believe that usually work smile.gif
(Or maybe you have to).
Go to the top of the page
 
+Quote Post
blakeyez
post Jun 12 2004, 06:38 AM
Post #5





Group: Members
Posts: 90
Joined: 5-June 04
Member No.: 3,580



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2014 - 08:46 AM