Re: [hatari-devel] Compiling with SDL2 without osx-bundle on OSX fails

[ Thread Index | Date Index | More Archives ]


I tried your change this evening. The good news is that it now works when you compile Hatari without using an OS X bundle. The bad news is you now get the exact “Undefined symbol _main” error if you compile it as an OS X bundle. On the endif for ENABLE_SDL2, you spelled it as ENDABLE_SDL2. I have attached a diff file if you prefer that.

However, even after fixing the typing error, I get an error that main is undefined. I am wondering if the add_definitions statement redefines both main functions (the one in main.c and SDLMain.m) as SDL_main. I could be completely wrong since I do not know anything about CMake other than cmake -G Xcode -DENABLE_SDL2=1. :) Your previous #define would only affect the main in main.c.

I also wanted to give a short status report on the SDL2 port for OS X. The only remaining problem that Miguel and I have is the appearance of the Create New Floppy window when you enter fullscreen or do anything that affects the window (change monitor type, remove borders, etc.). We have confirmed your thought that the other problems were bugs in the OS X version of SDL 2.0.3. Miguel compiled an “hg clone” of SDL and the problems do not appear there. At this point, I am confident that 2.0.4 (when released) will resolve the problems that we saw.

Since SDL2 requires 10.7 or later, I am thinking that the OS X port of Hatari will need to support SDL1 for the near future. I know there is a vocal minority of Hatari users who use 10.5 or 10.6. As soon as we can find the last problem, I intend to really start using the SDL2 port of Hatari as my main version to make sure it is solid.

Bob C

On Sep 11, 2014, at 3:44 PM, Thomas Huth <th.huth@xxxxxx> wrote:

> Hi,
> Am Sun, 7 Sep 2014 16:03:38 -0500
> schrieb Bob Carpenter <hatari@xxxxxxxxxx>:
>> Christer,
>> That is because main() in main.c is renamed to SDL_main if it is an
>> OS X binary. The current #if statement is assuming an OS X bundle.
> [...]
>> On Sep 7, 2014, at 8:54 AM, Christer Solskogen
>> <christer.solskogen@xxxxxxxxx> wrote:
>>> Linking C executable hatari
>>> Undefined symbols for architecture x86_64:
>>> "_main", referenced from:
>>>    implicit entry/start for main executable
>>>    (maybe you meant: _SDL_main)
> I now tried to fix this problem so that main only gets redefined when
> the bundle is enabled. Could you please check if it works since I do
> not have an OS X for testing?
> Thomas

Attachment: CMakeLists.diff
Description: Binary data

Mail converted by MHonArc 2.6.19+