I have created an MFC DLL and have exported the functions for example in the file SerialPort.h:
class CSerialPortApp : public CWinApp
{
public:
CSerialPortApp();
__declspec(dllexport) int SWrite(unsigned char* toSend, int len);
};
and in my MFC application I want to call the function in SerialInterface.h I have included the "SerialPort.h" from the DLL and called:
__declspec(dllimport) int SWrite(unsigned char* toSend, int len);
class SerialInterface
{
public:
};
for example.
I have added the SerialPort.lib file to my linker includes but when I try to compile I get
error LNK2001: unresolved external symbol "__declspec(dllimport) int __cdecl SWrite(unsigned char*, int)" (__imp_?SWrite@@YAHPAEH@Z)
I am stuck as to the cause of this, I have tried rebuilding everything but nothing seems to help?
Thank you for any help!