Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^4: h2xs on Windows

by cavac (Chaplain)
on Nov 23, 2011 at 15:02 UTC ( #939680=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^4: h2xs on Windows
Select or Download Code
Re^5: h2xs on Windows
by Anonymous Monk on Nov 23, 2011 at 15:12 UTC
    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.

        don't ask me to explain this idiocy

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

        Um, I can't explain, why the maintainers of ExtUtils::Liblist, "improved" their module, by necessitating :nosearch to get the old default behaviour

        I can't even remember why/when it changed, just that old way of people did things, you might get a dozen

        Note (probably harmless): No library found for -ltcl86 Note (probably harmless): No library found for -lmoldname Note (probably harmless): No library found for -lkernel32

        messages, but each and every -ltcl86 still got forwarded to the compiler/linker, and if the compiler/linker couldn't find -ltcl86 and it was really needed, then it would throw an error, and you'd know which one of the harmless warnings weren't harmless after all

        For example, mingw gcc, when you tell it -ltcl86, knows to check for a whole bunch of variations tcl86.lib, tcl86.a, tcl86.la, tcl86.o, libtcl86.lib, libtcl86.a, libtcl86.la, libtcl86.o... because it knows how to handle all these (both .a and .lib)

        But, MakeMaker/Liblist, after decades of letting the compiler/linker handle it as usual, finally tries to do its intended job (i guess), but it only consults

        $ perl -V:lib_ext lib_ext='.a';

        Which doesn't quite work for windows/mingw/gcc combination

        note: I'm aware some of the details above aren't 100% accurate, but the general gist is, liblist removes libs the compiler knows how to handle, :nosearch restores the old default

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-11-23 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (134 votes), past polls