I am trying to use DLL module to be generated using Borand C++.
The DLL and librabry is basically for controling hardware. So, the company provided the DLL, Library source and source codes.
In header file, Function is defined like these.
extern "C" WINAPI __declspec(dllexport) int NmcInit(char *portname, unsigned int baudrate);
extern "C" WINAPI __declspec(dllexport) void InitVars(void);
extern "C" WINAPI __declspec(dllexport) BOOL NmcSendCmd(byte addr, byte cmd, char *datastr, byte n, byte stataddr);
extern "C" WINAPI __declspec(dllexport) void FixSioError(byte addr);
extern "C" WINAPI __declspec(dllexport) void NmcShutdown(void);
//Module type independant commands (supported by all module types)
extern "C" WINAPI __declspec(dllexport) BOOL NmcSetGroupAddr(byte addr, byte groupaddr, BOOL leader);
extern "C" WINAPI __declspec(dllexport) BOOL NmcDefineStatus(byte addr, byte statusitems);
extern "C" WINAPI __declspec(dllexport) BOOL NmcReadStatus(byte addr, byte statusitems);
extern "C" WINAPI __declspec(dllexport) BOOL NmcSynchOutput(byte groupaddr, byte leaderaddr);
So, To use thses DLL, I put the DLL and Library file into the project directory.
and then, I include the library file with add files.
and then, I made a header file to use DLL function. In the hearder file, I defined fucntions like these
int DLLEXPORT NmcInit(char *portname, unsigned int baudrate);
void DLLEXPORT InitVars(void);
BOOL DLLEXPORT NmcSendCmd(byte addr, byte cmd, char *datastr, byte n, byte stataddr);
void DLLEXPORT FixSioError(byte addr);
void DLLEXPORT NmcShutdown(void);
But, with these setting, when i used these fuctions, I received an error message like this
Undefined symbol '_NmcInit' referenced in "server.c".
How to solve this problem? I don't really know this problem..
I need your help...