February 6th, 2010, 10:42 AM
link errors, while using dll of a sensor from c++ 6.o
For one of the sensors that I have bought. The company supplied me with header file, library file and the dll. Now I have written a simple code in order to access the values. There are no compilation errors but 2 link errors.
What I have done is that in Project settings->preprocesser->include directories, I have given the path of where my header file is, in my case I have set to D:\Program Files\Microsoft Visual Studio\MyProjects\sensor\MTCSApi.h because this is where I have placed my header file (could be wrong). Similarly for linker I have given the path putting .lib file in debug folder where my exe also exists.
I have written a small code
/* The actual call to the function contained in the dll */
int ReturnVal = MTCSInitSystem("0", 0x152a, 0x8220);
and the following are the errors I get,
sen2.obj : error LNK2001: unresolved external symbol __imp__MTCSGetADCAVR2
Debug/Sensor2.exe : fatal error LNK1120: 1 unresolved externals
I am absolutely confused despite of changing all the project settings. Can anyone give me a solution. I dont know whether to use MFC shared DLL option and havent tried it. What do you guys say, since I am stuck here for past few days.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!