Re: creating shared dlls yields undefined reference to `WinMain@16' in mingw 4.3

"Daniel Walter" <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
GetProcAddress can be used to find the address of a function if it is 
exported, though WinMain is generally not exported.  Windows processes are 
started with an entry point address that comes from the exe header, not from 
a symbol.  I tried searching an exe for WinMain with grep and then looked 
for symbols with dumpbin and didn't find anything.

I am not sure how it helps to have an address for WinMain though.  If I 
understand things properly, this is being used to backtrace the stack for 
exception information.  Unless I am wrong and there is compatibility between 
MS and GCC call stacks, this won't be able to trace back to WinMain anyway.

Daniel

----- Original Message ----- 
From: "Andrew Haley" <[email protected]>
To: "Daniel Walter" <[email protected]>
Cc: "Danny Smith" <[email protected]>; <[email protected]>
Sent: Thursday, December 18, 2008 5:16 AM
Subject: Re: creating shared dlls yields undefined reference to `WinMain@16' 
in mingw 4.3


> Daniel Walter wrote:
>> Thank you for all the help on this. For anyone who is searching the
>> archives for MinGW gcj information, I will summarize.
>>
>> 1. If you are trying to build a dll in MinGW, you may need to make a
>> dummy WinMain function.
>
> This is wrong, though.  Surely someone knows if Windows has something
> like dlsym().
>
> Andrew.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.