Quote Originally Posted by Alex F View Post
Linker cannot find ConnectDevice and DisconnectDevice functions implementation. There are only function prototypes. For example:

Code:
void ConnectDevice(char*, char*);
void DisconnectDevice(char*, char*);

int main()
{
    ConnectDevice("1", "2");
    DisconnectDevice("1", "2");
}
Such program compiles, but linker gives unresolved external symbol error.
Hi
I am having ICM330_0170DLL.h,ICM330_0170DLL.dll and ICM330_0170DLL.lib files given by my customer now to get a new dll based on these files.I worte a new cpp file as .....
#define NOMINMAX

#ifdef WIN32
#include <windows.h>
#include <crtdbg.h>
#endif



#include <time.h>
#include <iostream>
#include <limits>
#include <vector>
#include <math.h>
#include <cstdio>

#include <jni.h>

#include "sparsha_CardReader.h"


#include "ICM330_0170DLL.h"

using namespace std;


#undef RANDOMLY_REJECT_BILLS
#undef ASK_ABOUT_BILLS
#undef IGNORE_ESCROW_EVENTS

// Global variables:

static char *upload_filename = NULL;
static int amount=0;
static string str="good";
jclass cls;
jfieldID fid;
jint flag;
JNIEnv *env;
jobject obj;
jstring objst;

JNIEXPORT void JNICALL Java_sparsha_CardReader_CardReadering
(JNIEnv *, jobject){
char *argv[]={"port=COM1"};
char *argvs[]={"baudrate=38400"};
cout<<"Starting cctalk application event manager with caRD\n";
ConnectDevice( *argv, *argvs);

}
JNIEXPORT void JNICALL Java_sparsha_CardReader_stopCardReader
(JNIEnv *, jobject)
{
char *argv[]={"COM1"};
cout<<"ENDING cctalk application event manager with caRD\n";
DisconnectDevice( *argv);
}

and compiling this cpp file by using command:
Cl/LD sparsha_Reader.cpp /NXCOMPAT /MACHINE:X86 /LINK "D:\sparsha\new\RamyamICM3301\ICM330-0170DLL\ICM330_0170DLL.lib"

then i am getting this error as described above.
if i compile using command like....
Cl/LD sparsha_Reader.cpp /NXCOMPAT /MACHINE:X86 /LINK "D:\sparsha\new\RamyamICM3301\ICM330-0170DLL\ICM330_0170DLL.dll"
i am getting error ...
D:\sparsha\new\RamyamICM3301\ICM330-0170DLL\ICM330_0170DLL.dll
D:\sparsha\new\RamyamICM3301\ICM330-0170DLL\ICM330_0170DLL.dll : fatal error LNK
1107: invalid or corrupt file: cannot read at 0x2A8



when i am compiling i am getting .obj,.exp,.lib and .dll.manifest files
i am new to cpp so what to do now?
anybody can help me...