Mailing-List: contact cygwin-help@sourceware.cygnus.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@sources.redhat.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@sources.redhat.com>
List-Help: <mailto:cygwin-help@sources.redhat.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@sources.redhat.com
Delivered-To: mailing list cygwin@sources.redhat.com
Message-ID: <20010507110332.22447.qmail@web6404.mail.yahoo.com>
Date: Mon, 7 May 2001 21:03:32 +1000 (EST)
From: =?iso-8859-1?q?Danny=20Smith?= <danny_r_smith_2001@yahoo.co.nz>
Subject: RE: Using setupapi.lib/h/dll from cygwin
To: Svein Erling Seldal <Svein.Seldal@edcom.no>,
        "Larry Hall \(RFK Partners, Inc\)" <lhall@rfk.com>, cygwin@cygwin.com
In-Reply-To: <NEBBLKFNEDOFBCDCJMLKIEJGCDAA.Svein.Seldal@edcom.no>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit


--- Svein Erling Seldal <Svein.Seldal@edcom.no> wrote: > 
> > From: Larry Hall (RFK Partners, Inc) [mailto:lhall@rfk.com]
> >
> > At 06:56 PM 5/5/2001, Svein Erling Seldal wrote:
> > >Well, how is this done?
> > >
> > >If I use: 'gcc -o foo foo.o'
> > >Returns: foo.o(.text+0x1b):foo.c: undefined reference to
> > >`_imp__SetupDiGetClassDevsA@16'
> > >
> > >If I use: 'gcc -o foo foo.o setupapi.lib'
> > >Returns the same
> >
> >
> > OK, what does the symbol in setupapi.lib look like?  What you did should
> > work if the symbol is in the library and matches the reference exactly.
> 
> OK. I get your point:
> 
> My app requires "SetupDiGetClassDevs()". When compiled, it generates a
> reference to "SetupDiGetClassDevsA@16" *or* "_imp__SetupDiGetClassDevsA@16"
> (depending on wheter og not I edit the original MS setupapi.h file, where I
> remove the #define WINSETUPAPI DECLSPEC_IMPORT setting or not).
> 
> Now, the MS provided setupapi.lib, however, defines these symbols as:
> "_SetupDiGetClassDevsA" and its imported reference as
> "__imp__SetupDiGetClassDevsA". That's why it isnt working.
> 

Are you sure about that? That's what nm says but I think gcc nm (&ld) is
misreading the implib  MS PSDK dumpbin shows the stdcall decoration. setapi.dll
is a strange one in that it can use a remote drive or a removeable drive for
swap file storage - this is in the dll image header.  Maybe the MS implib is a
bit strange as well.


> So the fix to this problem is either: 1) I need to generate a libsetupapi.a
> which uses the GNU naming method somehow. Or 2) tell the GNU compiler not to
> use the '@16' postfix-scheme on this specific library/dll. Correct?
> 
To fix the problem, you need a def file and then rebuild the implib as per the
rest of the w32api implibs.  A submission to w32api maintainer will be in the
pipe tomorrow.

> Regards,
> Svein Erling Seldal
> 
> 
> --
> Want to unsubscribe from this list?
> Check out: http://cygwin.com/ml/#unsubscribe-simple
> 


_____________________________________________________________________________
http://store.yahoo.com.au - Yahoo! Store
- It's time you had your business online!

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

