I'm having a problem with compilation of code with winscard.h from mingw-w32-bin_i686-mingw_20110429 getting "undefined reference to `_imp__g_rgSCardT1Pci'".
Your toolchain indicates that it uses the trunk version of import libraries. lib32/winscard.def has:
g_rgSCardRawPci@4
g_rgSCardT0Pci@8
g_rgSCardT1Pci@8
… at the end of the file, but these are exported data, not exported functions. So we must remove the stdcall suffixes from them, and then maybe mark them as DATA as is the case with the trunk version of lib64/winscard.def (the release branch version of lib64/winscard.def doesn't mark them as DATA, btw…) Revising the other stdcall/fastcall suffixes in lib32/winscard.def further, wouldn't hurt either…
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A note, though: gendef generates those exports without stdcall suffixes from the winxp version of the dll. With the vista version of the dll, however, it does add the suffixes. Ugh..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Can't attach files here. Sent you a private message using sf.net mail interface. Please reply to it so I can send you an updated import library as a mail attachment.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm having a problem with compilation of code with winscard.h from mingw-w32-bin_i686-mingw_20110429 getting "undefined reference to `_imp__g_rgSCardT1Pci'".
Compiling with "c:\MinGW\i686-w64-mingw32\bin>gcc main_tiny.c -o main -L. -lwinscard"
This is just code snippet original code I'm trying to compile is {here}.
I can see definition in winscard.h as follows:
but linker still complains.
Any help is much appreciated.
Thanks.
JB
Your toolchain indicates that it uses the trunk version of import libraries. lib32/winscard.def has:
g_rgSCardRawPci@4
g_rgSCardT0Pci@8
g_rgSCardT1Pci@8
… at the end of the file, but these are exported data, not exported functions. So we must remove the stdcall suffixes from them, and then maybe mark them as DATA as is the case with the trunk version of lib64/winscard.def (the release branch version of lib64/winscard.def doesn't mark them as DATA, btw…) Revising the other stdcall/fastcall suffixes in lib32/winscard.def further, wouldn't hurt either…
A note, though: gendef generates those exports without stdcall suffixes from the winxp version of the dll. With the vista version of the dll, however, it does add the suffixes. Ugh..
Hi sezero,
thanks for a prompt response, is there anything I can help with?
Can't attach files here. Sent you a private message using sf.net mail interface. Please reply to it so I can send you an updated import library as a mail attachment.
OK, the following fix:
… is confirmed to work in private mail. I posted the fix to the developers list for review.
Hi Sezero,
thank you very much for your help. It is very appreciated.
JB
Fixed in the svn repo at rev. 4158.