Re: [AD] END_OF_MAIN, again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 2005-07-30 at 15:54 +0200, Hrvoje Ban wrote:
> On 7/30/05, Elias Pschernig <elias@xxxxxxxxxx> wrote:
> What is the exact message? And any way to get rid of it?
>
> LINK : warning LNK4049: locally defined symbol "___install_allegro"
> imported
> LINK : warning LNK4049: locally defined symbol "__mangled_main"
> imported
>
> I don't know much about MSVC (I dig up old version 6), so I could make
> something wrong during library compilation.
Hm, must thinkg about this some more. What you have is this:
example.c: Simply defines a function _mangled_main instead of main (due
to the #define main _mangled_main which is still present)
allegro.lib: Has the WinMain, which calls _mangled_main.
So I don't see where it goes wrong. I'm sure someone else does though,
let's wait..
>
>
> The problem in OSX is different.. main() must not be in the
> main thread
> there. So the real main() created a thread, and then calls the
> user
> main() (renamed to _mangled_main) in that other thread.
>
> I got that, I was suggestion that instead of using
> _mangled_main_address, we use _manged_main as:
>
> + (void)app_main: (id)arg
> /* int (*real_main) (int, char*[]) = (int (*) (int, char*[]))
> _mangled_main_address;*/
> int (*real_main) (int, char*[]) = (int (*) (int, char*[]))
> &_mangled_main;
> exit(real_main(__crt0_argc, __crt0_argv));
>
True. It's the same you do in windows - instead of storing the address
of the main function in a function pointer, you simply call it.
But surely someone thought of that in the past discussions on this topic
- so there must be another catch.
--
Elias Pschernig