Yet another "undefined reference to `_WinMain@16'" in cygwin

S

Sam Denton

I'm getting this message when linking under Cygwin. I've googled the
message text and found several of "voodoo" fixes (i.e. "This worked
for me but I don't know why"). I've blindly tried several of them,
but none of them worked.

Yesterday, I installed the Gnu plotutils package, without apparent
problems (once I found out to use "./configure --enable-libplotter").
Now I'm trying to install the Perl Graphics::plotter module. The only
fix that I haven't tried is to add a dummy WinMain function, but since
I'm trying to create a .DLL, not a .EXE, I'm unsure of the
ramifications. Is there a special flag that I don't know about?

Here's the last bit of output from make (with the voodoo incantation
"-Wl,-u,_WinMain@16" still included):

Running Mkbootstrap for Graphics::plotter ()
chmod 644 Plotter.bs
rm -f blib/arch/auto/Graphics/Plotter/Plotter.dll
LD_RUN_PATH="/usr/local/lib" g++ -s -L/usr/local/lib Plotter.o
-Wl,-u,_WinMain@
16 -o blib/arch/auto/Graphics/Plotter/Plotter.dll
/usr/lib/perl5/5.8.0/cygwin-m
ulti-64int/CORE/libperl.dll.a -L/usr/local/lib -lplotter
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(libcmain.o)(.text+0x7c)
: undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Graphics/Plotter/Plotter.dll] Error 1
 
A

A. Sinan Unur

(e-mail address removed) (Sam Denton) wrote in
I'm getting this message when linking under Cygwin. I've googled the
message text and found several of "voodoo" fixes (i.e. "This worked
for me but I don't know why"). I've blindly tried several of them,
but none of them worked.

I do not _know_ the solution, but have you looked at

http://cygwin.com/faq/faq_toc.html#TOC95

and

http://cygwin.com/cygwin-ug-net/dll.html

I am only asking this because I do not see a `shared' flag anywhere, and it
looks like, from the line
LD_RUN_PATH="/usr/local/lib" g++ -s -L/usr/local/lib Plotter.o

you are stripping symbols. Again, I am no expert on cygwin, but those look
like problem spots to me. Have you tried asking this question on the cygwin
mailing list?

Sinan.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top