Link to home
Start Free TrialLog in
Avatar of Kkto
KktoFlag for Spain

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
Avatar of Member_2_1001466
Member_2_1001466

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).
Avatar of Cayce
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

Avatar of Kkto

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
No objection.
Yeah, No objection
ASKER CERTIFIED SOLUTION
Avatar of modulo
modulo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial