If you are linking the DLL implicitily you have to add the *.h and the *.lib, and store the DLL in the application directory or in the Windows system directory.
If you are using it explicitely (LoadLibrary), you don´t need to add any file.
Caronte
Si tiene solución... ¿por qué te preocupas?
Si no tiene solución... ¿por qué te preocupas?
I am not sure whether I have done is correct or not.
I have this dll called 'com.dll'. I have all the files to develop this dll.
Now in my won workspace called 'test', I want to open a serial port. 'com.dll' could do everything for me, but I need to give the portname and baud rate.
#include portRSR232.h //this file is in the folder to build the DLL
in my callforPortfunc()
{
.....
s8* name = "COM1";
port = new RS232Port(name);
port->openPort();
}
However, I got these errors as below. Is there any where in VS6 where I need to define the path for the DLL?
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::setDevicePath(char const *)" (?setDevicePath@RS232Port@@UAEHPBD@Z)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall RS232Port::getDevicePath(void)" (?getDevicePath@RS232Port@@UAEPBDXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::waitForDisconnect(void)" (?waitForDisconnect@RS232Port@@UAEHXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall RS232Port::GetPortType(void)" (?GetPortType@RS232Port@@UAEIXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall RS232Port::getBaudRate(void)" (?getBaudRate@RS232Port@@UAEIXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::changeBaudRate(unsigned int)" (?changeBaudRate@RS232Port@@UAEHI@Z)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::writePort(unsigned char *,unsigned int,unsigned int)" (?writePort@RS232Port@@UAEHPAEII@Z)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::readPort(unsigned char *,unsigned int,unsigned int)" (?readPort@RS232Port@@UAEHPAEII@Z)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port::closePort(void)" (?closePort@RS232Port@@UAEHXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall RS232Port:penPort(void)" (?openPort@RS232Port@@UAEHXZ)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall RS232Port::RS232Port(char const *)" (__imp_??0RS232Port@@QAE@PBD@Z)
FlashZap_TestDlg.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall RS232Port::~RS232Port(void)" (__imp_??1RS232Port@@UAE@XZ)
Debug/FlashZap_Test.exe : fatal error LNK1120: 12 unresolved externals
Error executing link.exe.
Bookmarks