[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] END_OF_MAIN, again
- From: Hrvoje Ban <spoofer255@xxxxxxxxxx>
- Date: Sat, 30 Jul 2005 12:49:39 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type; b=rpmWtTQb5uYEdi5S2PE9S2OvxAMnm6t8Oxa3HIxqTPI9FEquU+ydg03TWRp67phPca1z/dSbmZfTd8cBq8Qzy+IkRIm5mIeIeOH16hLMtAhaTcRUQpakEuWYQLz60VGKud5nBl1dlGO6bmQSSoKnBIJieNnWPFCviduTYazrv2Y=
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.
After dll and import libraries are created I compiler wmain.c and
include it in liballeg.a. This should work with MSVC too. About
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.
Attachment:
alwin.h.diff
Description: Binary data
Attachment:
wmain.c
Description: Binary data