http://qs1969.pair.com?node_id=939680


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.