Re: [AD] END_OF_MAIN, again |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Sat, 2005-07-30 at 12:49 +0200, Hrvoje Ban wrote:
> In my previous attempt to get rid of this macro I tried to place
> WinMain inside dll. This didn't work since WinMain need address of
> user's main and you can't have weak links inside dll. So I tried to
> place WinMain inside generated import library. This worked but linker
> would skip my WinMain and report it missing. I was searching trough
> MinGW archives and found answer. WinMain or any function in same file
> as WinMain must be referenced by user code or linker will skipp whole
> file. So I made dummy __install_allegro and place it with WinMain and
> macro original install_allegro to point mine. This worked like charm
> and I was able to compile all examples without any trouble.
Will it work if the user code uses allegro_init?
> After dll and import libraries are created I compiler wmain.c and
> include it in liballeg.a. This should work with MSVC too. About
Need to have someone test it under MSVC.
> Linux/Unix/MacOS, I'm not sure that these use import libraries, but
> are using allegro-config which can be changed to include one more
> library (liballeg-main.a) that will contain real main.
Unix already doesn't do anything in END_OF_MAIN. But there's no known
way to get rid of it under OSX so far.
--
Elias Pschernig