X-Spam-Check-By: sourceware.org
From: "Harold Mills" <harold.mills@novaspeech.com>
To: <cygwin@cygwin.com>
Subject: Re: dll link error using Cygwin gcc
Date: Wed, 13 Jun 2007 14:45:29 -0400
Message-ID: <000001c7adeb$04468a00$0cd39e00$@mills@novaspeech.com>
MIME-Version: 1.0
Content-Type: text/plain; 	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 12.0
Content-Language: en-us
x-cr-hashedpuzzle: AMas Bo7m Cnks DSdw D4+y EbHW F2vQ F5Nu GNHe HTyB ICz7 I0mt Jxmk KoLX Lo0W NFQs;1;YwB5AGcAdwBpAG4AQABjAHkAZwB3AGkAbgAuAGMAbwBtAA==;Sosha1_v1;7;{DFBD246D-117B-4CF7-A65F-0CC2DC481E3C};aABhAHIAbwBsAGQALgBtAGkAbABsAHMAQABuAG8AdgBhAHMAcABlAGUAYwBoAC4AYwBvAG0A;Wed, 13 Jun 2007 18:45:26 GMT;UgBlADoAIABkAGwAbAAgAGwAaQBuAGsAIABlAHIAcgBvAHIAIAB1AHMAaQBuAGcAIABDAHkAZwB3AGkAbgAgAGcAYwBjAA==
x-cr-puzzleid: {DFBD246D-117B-4CF7-A65F-0CC2DC481E3C}
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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.

Cheers,

    Harold Mills



--
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/

