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

Andrew Haley <[email protected]>
Newsgroups gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Daniel Walter wrote:
> Whenever I add an object file that was generated with gcj to a g++ link
> command for a shared dll, I get an undefined reference to `WinMain@16'.
> This seems to indicate that for some reason gcc wants to build an
> executable instead of a shared library.  This was working in gcc 3.4 -
> though I was using cygwin with gcj -mno-cygwin which is no longer
> supported.
> 
> Is building dlls with g++ and gcj supported in newer versions of gcc?
> Is there a different link command that will not try to build an executable?
> 
> 
> works> g++ -shared cpptest.o -o pdflib.dll
> 
> works - event with lgcj> g++ -shared cpptest.o -lgcj -lws2_32 -o pdflib.dll
> 
> fails - it tries to build an executable> g++ -shared javatest.o cpptest.o -lgcj -lws2_32 -o pdflib.dll

More information needed.  'g++ -v' will show you what is being linked.
There is presumably a way to ask what symbols are needed by the various
libraries that you're linking, so have a look which one needs `WinMain@16'.

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.