This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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" <aph@redhat.com>
To: "Daniel Walter" <d2walter@hotmail.com>
Cc: "Danny Smith" <dansmister@gmail.com>; <java@gcc.gnu.org>
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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]