unresolved external symbol (trying to use C_SetPin function)

hi

i'm writing a program to utilize the C_Setpin() function from the dkck201.dll library (iKey2000 usb token). I want to write a simple console program which can change the token's pin.

Here's my source code (I just modified it from the Secpin.cpp example taken from the sample201 folder.


#include "stdafx.h"
#include "test.h"
#include "dkcryp32.h"
#include "SPinDlgs.h"
#include "typemap.h"
#include <iostream.h>

int main(){

cout<<"Test here";

}

void OnCommonChangePin()
{
char oldPinBuf[256];
char newPinBuf[256];
char newPin2Buf[256];
char *oldPin = oldPinBuf;
char *newPin = newPinBuf;
char *newPin2 = newPin2Buf;
int oldPinLen;
int newPinLen;
int newPin2Len;
CK_RV RV;
int RC;
CmnCP cmnCP;

cout<<"Change PIN - Unprotected Authentication";

strcpy(oldPin, cmnCP.m_oldPin);
strcpy(newPin, cmnCP.m_newPin);
strcpy(newPin2, cmnCP.m_newPin2);
oldPinLen = strlen(oldPin);
newPinLen = strlen(newPin);
newPin2Len = strlen(newPin2);

C_Logout(NULL);

RV = C_Login(NULL, CKU_USER, (unsignedchar *)oldPin, (CK_USHORT)oldPinLen);
if (RV != CKR_OK)
{
cout<<"The Pass Phrase enteredis not allowed to login, or you have exceeded your limit of incorrect Pass Phrases.";
return;
}

RV = C_SetPIN(NULL, (unsignedchar *)oldPin, (CK_USHORT)oldPinLen, (unsignedchar *)newPin, (CK_USHORT)newPinLen);
if (RV != CKR_OK)
{

cout<<"The Change Pass Phrase failed.";
return;
}
else
{

cout<<"Change Pass Phrase successful";
}
}

It compiled successfully, but when I try to run it, the following message appears:
========================================================
Linking...
imin.obj : error LNK2001: unresolved external symbol "public: __thiscall CmnCP::CmnCP(class CWnd *,class CString)" (?0CmnCP@@QAE@PAVCWnd@@VCString@@@Z)
Debug/imin.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

imin.exe - 2 error(s), 0 warning(s)
========================================================
I have set my Project Settings>Link>General>Object library modules: C:\SafeNet\iKey2000\Kit\LIB\dkck201.lib
to link to the lib file, added the path to C:\SafeNet\iKey2000\Kit\H\201 in the additional include directories, but the problem still persist.

I hope anyone here can help me. Any help is greatly appreciated. Thanks.

[3468 byte] By [imin] at [2007-12-16]
# 1
this problem is now solved.. i just removed the unneeded header files.
thank you
imin at 2007-9-9 > top of Msdn Tech,Visual C++,Visual C++ General...