![]() ![]() |
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. |
|
|
|
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. |
|
|
|
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. |
|
|
|
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
(Or maybe you have to). |
|
|
|
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 |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 22nd May 2013 - 09:21 PM |