delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <48FC5562.1DDA1FAE@dessent.net> |
Date: | Mon, 20 Oct 2008 02:54:42 -0700 |
From: | Brian Dessent <brian AT dessent DOT net> |
X-Mailer: | Mozilla 4.79 [en] (Windows NT 5.0; U) |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: [perl] Portably linking to libstdc++ |
References: | <586E6C4720134D06B35A67112D3BBBCE AT desktop2> <C9004AE9971E4B7ABBC246E73FC599AF AT desktop2> <48FB462B DOT 4B75336B AT dessent DOT net> <BA6845624D6F4E01AA4E2CCEC494A9E5 AT desktop2> |
X-IsSubscribed: | yes |
Reply-To: | cygwin AT cygwin DOT com |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Sisyphus wrote: > Of course, the other option on both linux and cygwin is to set *both* > $Config{cc} and $Config{ld} to 'g++', and that works fine on linux, but > doesn't quite work on cygwin where I still get an undefined reference to > `_WinMain AT 16': > > /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libcygwin.a(libcmain.o):(.text+0xab): > undefined reference to `_WinMain AT 16' > collect2: ld returned 1 exit status > > Why does that happen ? The error means you tried to link an executable that didn't contain a main() function. The fact that it refers to a missing WinMain() is incidental, a byproduct of some compatibility code in Cygwin that provides a backup main() which calls WinMain(), allowing the Windows-style tradition where the user provides a WinMain() instead of main(). Regardless of how it's spelled, you can't link an executable without a proper entrypoint which is all the error means. Please post the entire link command and not just the error. It's impossible to say what the true nature of the problem is otherwise. For example, if you're trying to link a library and not an executable then the above error would be due to missing the "-shared" flag. Brian -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |