| delorie.com/archives/browse.cgi | search |
| X-Spam-Check-By: | sourceware.org |
| From: | "Dave Korn" <dave DOT korn AT artimi DOT com> |
| To: | <cygwin AT cygwin DOT com> |
| References: | <000001c7adeb$04468a00$0cd39e00$@mills AT novaspeech DOT com> |
| Subject: | RE: dll link error using Cygwin gcc |
| Date: | Wed, 13 Jun 2007 19:48:23 +0100 |
| Message-ID: | <01cc01c7adeb$6b351830$2e08a8c0@CAM.ARTIMI.COM> |
| MIME-Version: | 1.0 |
| X-Mailer: | Microsoft Office Outlook 11 |
| In-Reply-To: | <000001c7adeb$04468a00$0cd39e00$@mills@novaspeech.com> |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Id: | <cygwin.cygwin.com> |
| List-Unsubscribe: | <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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 |
On 13 June 2007 19:45, Harold Mills wrote:
> As Dave Korn and Brian Dessent both pointed out, my problem was that gcc was
> compiling Hello.c with the default cdecl calling convention, but the library
> I wanted to link to uses the stdcall convention. Adding __stdcall to the
> function declarations in the header file eci.h fixed the problem. Dave
> suggested using the --enable-stdcall-fixup link option, which from the ld
> documentation did seem like it would do the trick, but I couldn't get it to
> work. I specified it to gcc as -Wl,--enable-stdcall-fixup, but still got the
> "undefined reference" error message.
In any case, Brian was right and my suggestion was wrong: if the library was
compiled with a different calling convention, bodging the symbols to match up
isn't the right thing to do, because the code will go wrong at runtime.
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
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 |