From: Andrew Haley <aph@redhat.com>
To: Daniel Walter <d2walter@hotmail.com>
Cc: java@gcc.gnu.org
Subject: Re: creating shared dlls yields undefined reference to `WinMain@16' in mingw 4.3
Date: Tue, 16 Dec 2008 10:39:00 -0000 [thread overview]
Message-ID: <49478553.4090906@redhat.com> (raw)
In-Reply-To: <BLU138-DAV8188D9A7984D9F7DF77CB80F50@phx.gbl>
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.
next prev parent reply other threads:[~2008-12-16 10:39 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-16 5:54 Daniel Walter
2008-12-16 10:39 ` Andrew Haley [this message]
2008-12-16 16:31 ` Daniel Walter
2008-12-16 17:30 ` Andrew Haley
2008-12-16 20:11 ` Daniel Walter
2008-12-16 20:26 ` Andrew Haley
2008-12-16 20:55 ` Daniel Walter
2008-12-17 7:47 Danny Smith
2008-12-17 10:35 ` Andrew Haley
2008-12-17 18:45 ` Daniel Walter
2008-12-17 18:56 ` Andrew Haley
2008-12-18 4:12 Daniel Walter
2008-12-18 10:17 ` Andrew Haley
2008-12-18 11:42 ` BGB
2008-12-18 17:03 ` Daniel Walter
2008-12-19 5:44 ` BGB
[not found] ` <BLU138-DAV5CF88D886B9DC7B21FB2F80F00@phx.gbl>
2008-12-19 20:07 ` BGB
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49478553.4090906@redhat.com \
--to=aph@redhat.com \
--cc=d2walter@hotmail.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).