Thanks. Sorry I didn't see this sooner.

I tried that first. So, after reading your note I searched the entire C: drive (where MinGW is installed).

I found another libsetupapi.a in C:\Perl-5.22.1-64\site\lib\auto\MinGW\x86_64-w64-mingw32\lib

And specifying that does compile. Apparently Inline::C installs it there. But hardcoding a path makes this very unportable to another system.

So, the new question is: how do I get that path portably?

I can use Config; $Config{sitelibexp} for part of the way: 'C:\Perl-5.22.1-64\site\lib' (which also appears in @INC)

But this is magic: "\auto\MinGW\x86_64-w64-mingw32\lib" There some pkg-config -like method for Perl...

For now, I use this expensive hack

use File::Find; my $libpath; my $incpath; BEGIN { find( { wanted => sub { /^libsetupapi\.a$/i && ($libpath ||= $File::Find::dir); /^setupapi\.h$/i && ($incpath ||= $File::Find::dir); }, follow => 1, follow_skip => 2 }, @INC ); die( "No MinGW libsetupapi $libpath $incpath\n" ) unless( $libpath && $incpath ); } use Inline( C => Config => libs => "-L$libpath -lSetupAPI", INC => "-I$incpath", );

There must be a better way. Meantime, on to figuring out the mysteries of the Windoze APIs.


In reply to Re^2: A workaround, but not really a fix by tlhackque
in thread Win32/MingW SetupAPI usage woes with Inline::C by tlhackque

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.