delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/05/18:56:42

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
From: "Svein Erling Seldal" <Svein DOT Seldal AT edcom DOT no>
To: "Larry Hall \(RFK Partners, Inc\)" <lhall AT rfk DOT com>, <cygwin AT cygwin DOT com>
Subject: RE: Using setupapi.lib/h/dll from cygwin
Date: Sun, 6 May 2001 00:56:01 +0200
Message-ID: <NEBBLKFNEDOFBCDCJMLKEEJECDAA.Svein.Seldal@edcom.no>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
Importance: Normal
In-Reply-To: <4.3.1.2.20010504113950.01fbdb28@pop.ma.ultranet.com>
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

> >Hi,
> >
> >I'm building a GNU program which is dependent on functions from the MS
> >library 'setupapi.lib' (which in turn loads 'setupapi.dll').
> This library is
> >not included in the w32api package.
> >
> >How do I proceed to get this included into my program? I've successfully
> >compiled the program (using MS headers), but complete linking remains. It
> >misses and requires four functions which is exported in setupapi.dll.
> >
> >How do I include a custom dll into my program, like this?
> >
> >
> >Regard,
> >Svein Erling Seldal
>
>
>
> Add setupapi.lib to your link line.


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 AT 16'

If I use: 'gcc -o foo foo.o setupapi.lib'
Returns the same

If I use: 'gcc -o foo foo.o -L. -lsetupapi.lib'
Returns unknown library 'setupapi.lib'

If I rename setupapi.lib to libsetupapi.a and run 'gcc -o
foo -L. -lsetupapi'
Returns unknown library.

This is all caused (I think) by the missing symbols, which are found in the
public setupapi.dll file. And my question boils down to this: How do I
include a dll file like this into my application from GNU tools?


Regards,
Svein Erling Seldal


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019