I have three functions defined in a C++ Dll program developed under VS2010.
int __stdcall Scan()
{
...
}
int __stdcall Setup(int e_time, double s_value, double cs_value, double gain, int nIm, char* name)
{
...
}
int __stdcall TearDown()
{
....
}
I defined them in Program.def as
LIBRARY
EXPORTS
Scan @1
Setup @2
TearDown @3
I also have a headefile Program.h
//DLL Export-Import definitions
#define BUILD_DLL
#ifdef BUILD_DLL
#define EXPORT __declspec(dllexport)
#else
#define EXPORT __declspec(dllimport)
#endif
But I am getting some errors:
- "49 error LNK2001: unresolved external symbol Scan in Program.def line 1"
- "51 error LNK2001: unresolved external symbol Setup in Program.def line 1"
and
- "51 error LNK1120: 2 unresolved externals symbol in Program.lib"
Error message does not complain about the third function defined. I used /MAP option in the linker, and defined a file name for the map file, but I am not getting a MAP file output to check how these sysmbols are defined. I cannot use dumpbin program since build did not create a dll file yet.
I am stuck. Any help/pointers will be greatly appreciated. Thanks.
extern "C"or similar line to indicate not to mangle the name? - PaulMcKenzie