我已經成功構建了一個可以在Linux上使用Qt讀取Mifare 1K卡的程序。所以現在,我希望它能在Windows上運行。從我收集的信息來看,Windows上沒有PCSC-Lite端口,我需要使用Windows SDK中的winscard。我已經下載了它,並且從Windows中的Qt中獲取了很多未定義的參考錯誤(與MingW一起)。例如:Windows上的PCSC-Lite代碼
release/ReadCard.o:ReadCard.cpp:(.text+0x48e): undefined reference to `pcsc_stringify_error' release/ReadCard.o:ReadCard.cpp:(.text+0x5e9): undefined reference to `pcsc_stringify_error' release/ReadCard.o:ReadCard.cpp:(.text+0x7ed): undefined reference to `pcsc_stringify_error' release/ReadCard.o:ReadCard.cpp:(.text+0x2e56): undefined reference to `SCardListReaderGroups' release/ReadCard.o:ReadCard.cpp:(.text+0x3adc): undefined reference to `SCardListReaders' release/ReadCard.o:ReadCard.cpp:(.text+0x3cc6): undefined reference to `SCardListReaders' release/ReadCard.o:ReadCard.cpp:(.text+0x3f88): undefined reference to `SCardGetStatusChange' release/ReadCard.o:ReadCard.cpp:(.text+0x4274): undefined reference to `SCardConnect' release/ReadCard.o:ReadCard.cpp:(.text+0x4d1b): undefined reference to `SCardGetStatusChange
我也試過在項目中指定這些庫,但仍然失敗。
LIBS += -lwinscard -lpcsclite WinSCard.Lib
我已經刪除了pcsc_stringify_error,但如預期的那樣,我仍然有其他錯誤。我不知道如何在我的項目中實現OpenSC,即使它看起來很相似。你能詳細說明一下嗎? BTW,我嘗試在Visual C++ .NET編碼,當我使用的#include我可以使用SCardEstablishContext沒有任何問題,我沒有錯誤,但是當我使用Qt中的代碼我得到了錯誤。 –
amree
2009-12-02 05:09:47
這已經是一個關於Qt而不是PC/SC的問題。無法幫助你,知道你的工具。 – 2009-12-03 08:10:35