Kkto
asked on
[Linker error] Unresolved external "..."
I'm building a Win32 app using functions from WinPcap (http://winpcap.polito.it) to low-level access to Ethernet adapters.
I'm new to C++ Builder (i've ever used C over Linux), but i think it's almost right...
Everything compiles fine, but when linking i get the error:
------
[Linker error] Unresolved external '_PacketGetAdapterNames' referenced from \...path...\UNIT2.OBJ
------
I've installed both developers' pack and source code, but still there...
Can someone help?
Thanx all
I'm new to C++ Builder (i've ever used C over Linux), but i think it's almost right...
Everything compiles fine, but when linking i get the error:
------
[Linker error] Unresolved external '_PacketGetAdapterNames' referenced from \...path...\UNIT2.OBJ
------
I've installed both developers' pack and source code, but still there...
Can someone help?
Thanx all
You need a library with contains a function _PacketGetAdapterNames (). This is defined in packet32.h and is part of the packet.dll. So the code of the function is in an external file which won't be part of your executable. So the executable has to get to know how to call the function. Either link with packet.lib (or you need to load the dll and ask the function address from it to call it via a pointer set to that address).
You need to IMPLIB packet.dll, then use the resulting .LIB file on your project. That will solve the problem.
command:
c:\> IMPLIB Packet.LIB PACKET.DLL
command:
c:\> IMPLIB Packet.LIB PACKET.DLL
ASKER
Finally i found out...
packet.dll is compiled with MS Visual C++, while i'm using Borland C++ Builder; and that's all the trick.
In this case a "translation" is needed to let Borland Builder understand the LIBs from MSVC. All the proccess is located at http://www.bcbdev.com/articles/vcdll.htm
Thanx for your tips :D
packet.dll is compiled with MS Visual C++, while i'm using Borland C++ Builder; and that's all the trick.
In this case a "translation" is needed to let Borland Builder understand the LIBs from MSVC. All the proccess is located at http://www.bcbdev.com/articles/vcdll.htm
Thanx for your tips :D
No objection.
Yeah, No objection
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.