Re: [hatari-devel] SDL2 support (OS X) |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Thomas,
I did some additional research. It turns out that SDL_main is deprecated in SDL2 and is replaced by SDL_init. However, SDL_Init contains a main stub that conflicts with the main() in SDLMain.m.
I was able to get Hatari to compile by commenting out the main() that is in SDLMain.m. However, that appears to cause other side effects. The fullscreen mode works, but you lose your menu bar after you exit fullscreen mode. In addition, the OS X preferences are not available either. I am sure there are other problems with my build. I would never use it. However, so far, it appears that it should not require an entire rewrite in order to get SDL 2 running. Also, it looks like the fullscreen workaround in SDLMain.m can be eliminated under SDL2 and the fullscreen function can simply be called since the bug does not exist in SDL 2.
At this point, I realize I am spinning my wheels. However, I am hoping my research will help either Jerome or Miguel to figure out how to either use SDL_init and add the functionality from main() somewhere else or how to avoid using SDL_Init and do the work it does elsewhere in SDLMain.m.
Bob C
On Aug 4, 2014, at 7:34 AM, Thomas Huth <th.huth@xxxxxx> wrote:
> Am Sun, 3 Aug 2014 21:54:48 -0500
> schrieb Bob Carpenter <hatari@xxxxxxxxxx>:
>
>> In my attempts to get the OS X bundle to compile, I am stuck by one
>> last error (unless more errors appear after I solve this error):
>>
>> Undefined symbols for architecture x86_64:
>> "_SDL_main", referenced from:
>> -[HatariAppDelegate applicationDidFinishLaunching:] in SDLMain.o
>> ld: symbol(s) not found for architecture x86_64
>> clang: error: linker command failed with exit code 1 (use -v to see
>> invocation)
>
> Just for a test ... could you try to rename the main() function in
> src/main.c to SDL_main() instead?
>
> Thomas
>
>