-
November 27th, 2003, 02:53 AM
#1
Link DLL and LIB into workplace
Hi, I am currently testing 2 DLL and LIB. However I don't know how to link/insert these DLL and LIB into my MFC project?
Should I just insert project into workspace?
I tried to include some header files from other project as well. But the compiler returns me 'cannot open include file'. What is wrong?
I am using VS 6.
It is urgent. Hope someone can help me here.
Thank you.
-
November 27th, 2003, 03:00 AM
#2
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?
-
November 27th, 2003, 05:23 AM
#3
I see.
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.
-
November 28th, 2003, 03:04 AM
#4
Hi I think I have solved the problem. It is dependencies problem.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
On-Demand Webinars (sponsored)
|