From: Luke Dunstan <coder_infidel@ho...> - 2003-04-11 07:33:34
>From: Sinitsyn Valentine <Valentine.Sinitsyn@...>
>Reply-To: Sinitsyn Valentine <Valentine.Sinitsyn@...>
>To: Benjamin Riefenstahl <Benjamin.Riefenstahl@...>
>Subject: Re: [Mingw-users] Entry point issue
>Date: Fri, 11 Apr 2003 10:40:27 +0600
>BR> The correct user-level entry point in Windows programs is
>BR> WinMain(HINSTANCE,HINSTANCE,LPSTR,int). With most compilers You can
>BR> also use main(int,char**).
>BR> So why should your code link? What's your purpose? Or am I missing
>It's not my idea. This code was borrowed from NSIS installer
>(http://nsis.sourceforge.net) and my aim is to compile it using MinGW.
>The problem can be said in other words: how to define entry point for
>this binary in a good way? ld --entrypoint _WinMainCRTStartup@... works
>fine but is it portable? (i.e. does symbol name depend on GCC version
>or so)? And if it is not portable, are there any other ways to define
If you trying to ask 'How do I set the entry point in a way equivalent to
the MSVC flag /entry:"WinMain"', then the answer is 'Using the --entry
linker flag.'. It's always easier for people to solve your problem if you
explain what the problem is before asking about why your own solution
doesn't work :-). When you use "ld --entry WinMain" remove the
"-DWinMain=WinMainCRTStartup" compiler flag.
Hope that helps.
MSN Instant Messenger now available on Australian mobile phones. Go to