加密狗文件读取连接时出错!!![Linker Error],好困惑!!!
在C++Builder中提供了SchipApi.h, ssKeyApi.h, schiplibb.lib,sChip.PAS这四个文件,还提供了一个对加密狗关闭读写等操作的例子,但我的程序模仿例子中的头文件和参数,但是例子能运行成功,而我的程序没能运行成功!出现了:[Linker Error ]Unresolved external 'ClosesChip' referenced from E:\TEST\UNIT1.OBJ 之类的错误,
变量定义为:
private: // User declarations
HANDLE hKey;
WORD UID;
char szReadPswd[4];
char szWritePswd[4];
char szKeyPath[MAX_PATH*2];
bool __fastcall TryOpen();
public: // User declarations
__fastcall TMainForm(TComponent* Owner);
void __fastcall DisplayMessage(AnsiString info);
程序:
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include "schipapi.h" //外部文件
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
hKey = INVALID_HANDLE_VALUE;
UID = 0xffff;
*(int *)szReadPswd = -1;
*(int *)szWritePswd = -1;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TMainForm::DisplayMessage(AnsiString info)
{
static int LineCount = 0;
AnsiString x;
LineCount++;
x.printf("%d: %s", LineCount, info);
Memo1->Lines->Add(x);
}
//-----------------------------------------------------------------------
//---------------------------------------------------------------------------
void __fastcall TMainForm::CloseChip1Click(TObject *Sender)
{
AnsiString info;
info.printf("Handle 0x%x is to be closed.", hKey);
DisplayMessage(info);
ClosesChip(hKey); //这里调用关闭或打开加密狗句柄时出现[Linker Error] 好困惑
hKey = INVALID_HANDLE_VALUE;
}