Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: h2xs on Windows

by Eliya (Vicar)
on Nov 22, 2011 at 19:15 UTC ( #939520=note: print w/ replies, xml ) Need Help??


in reply to Re^2: h2xs on Windows
in thread h2xs on Windows

Putting them into LIBS doesn't help.

How exactly did you specify it?  I'm not 100% sure about Windows, but normally, putting

LIBS => "-L. -lopensc",

in the WriteMakefile() call in Makefile.PL should work just fine (IIRC, MakeMaker would expand the "." to an absolute path).

Did you see your -L/-l combo in the linking command issued when building the extension?  Did you get a warning like "Note (probably harmless): No library found for -lopensc" (in which case the respective LIBS spec would be removed from the link arguments)?


Comment on Re^3: h2xs on Windows
Select or Download Code
Re^4: h2xs on Windows
by cavac (Chaplain) on Nov 23, 2011 at 15:02 UTC

    LIBS => "-L. -lopensc",

    Yes, did that. MakeMaker complains that it has to expand the path and that it doesn't find opensc. But the dll is actually there:

    C:\src\chipcard_neu\opensc\Maplat-CCReader>perl Makefile.PL Set up gcc environment - 3.4.5 (mingw-vista special r3) Warning: '-L.' changed to '-LC:/src/chipcard_neu/opensc/Maplat-CCReade +r/.' Note (probably harmless): No library found for -lopensc MakeMaker (v6.56) Warning (non-fatal): Target 'dynamic' depends on targets in skipped se +ction 'dyn amic_lib' Warning (non-fatal): Target 'static' depends on targets in skipped sec +tion 'stat ic_lib' Writing Makefile for Maplat::CCReader::ccreadlib Writing Makefile for Maplat::CCReader C:\src\chipcard_neu\opensc\Maplat-CCReader>dir *.dll Volume in Laufwerk C: hat keine Bezeichnung. Volumeseriennummer: 8CF0-773E Verzeichnis von C:\src\chipcard_neu\opensc\Maplat-CCReader 15.07.2011 13:49 1.468.416 opensc.dll 1 Datei(en) 1.468.416 Bytes 0 Verzeichnis(se), 1.699.016.704 Bytes frei

    Then i run dmake -v for a while and then it breaks when making the CCReader.dll on this command:

    C:\Perl\site\bin\g++.exe -o blib\arch\auto\Maplat\CCReader\CCReader.dl +l -Wl,--ba se-file -Wl,dll.base -mdll -L"C:\Perl\lib\CORE" CCReader.o -Wl,--image +-base,0x22 270000 ccreadlib/libccreadlib.a C:\Perl\lib\CORE\perl512.lib C:\Perl\s +ite\lib\au to\MinGW\lib\libkernel32.a C:\Perl\site\lib\auto\MinGW\lib\libuser32.a + C:\Perl\s ite\lib\auto\MinGW\lib\libgdi32.a C:\Perl\site\lib\auto\MinGW\lib\libw +inspool.a C:\Perl\site\lib\auto\MinGW\lib\libcomdlg32.a C:\Perl\site\lib\auto\Mi +nGW\lib\li badvapi32.a C:\Perl\site\lib\auto\MinGW\lib\libshell32.a C:\Perl\site\ +lib\auto\M inGW\lib\libole32.a C:\Perl\site\lib\auto\MinGW\lib\liboleaut32.a C:\P +erl\site\l ib\auto\MinGW\lib\libnetapi32.a C:\Perl\site\lib\auto\MinGW\lib\libuui +d.a C:\Per l\site\lib\auto\MinGW\lib\libws2_32.a C:\Perl\site\lib\auto\MinGW\lib\ +libmpr.a C :\Perl\site\lib\auto\MinGW\lib\libwinmm.a C:\Perl\site\lib\auto\MinGW\ +lib\libver sion.a C:\Perl\site\lib\auto\MinGW\lib\libodbc32.a C:\Perl\site\lib\au +to\MinGW\l ib\libodbccp32.a C:\Perl\site\lib\auto\MinGW\lib\libcomctl32.a C:\Perl +\site\lib\ auto\MinGW\lib\libmsvcrt.a dll.exp

    It fails with a lot of "undefined reference" messages, all for functions in opensc.dll:
    ccreadlib/libccreadlib.a(ccreadlib.o):ccreadlib.c:(.text+0x2c): undefi +ned refere nce to `sc_card_ctl' ccreadlib/libccreadlib.a(ccreadlib.o):ccreadlib.c:(.text+0x144): undef +ined refer ence to `sc_release_context' ccreadlib/libccreadlib.a(ccreadlib.o):ccreadlib.c:(.text+0x157): undef +ined refer ence to `sc_unlock' ccreadlib/libccreadlib.a(ccreadlib.o):ccreadlib.c:(.text+0x164): undef +ined refer ence to `sc_disconnect_card' ...

    If i run this command manually and add -L. -lopensc, it works. Then i can continue the run of dmake to completion. The tests that use the DLL-functions run fine and everything.

    Don't use '#ff0000':
    use Acme::AutoColor; my $redcolor = RED();
    All colors subject to change without notice.
      Try prefixing LIBS with ":nosearch", don't ask me to explain this idiocy

        Try prefixing LIBS with ":nosearch"

        YES!!!! (insert image of me jumping up and down in joy to a comic sound)

        That did it! Thanks! You just saved my day!

        don't ask me to explain this idiocy

        Oh, come on. Since this problem will probably affect other people too, it could be helpfull.

        Don't use '#ff0000':
        use Acme::AutoColor; my $redcolor = RED();
        All colors subject to change without notice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939520]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-08-30 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls