This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Using setupapi.lib/h/dll from cygwin



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]