Linker Error

I am getting the following linker error…
The required lib and dlls are present and the path also i have set properly.
How do i get arnd this? When i got this same error while working on a visual
c project i simply added the lib file to the proj. What can i do in this
case and how??
Any help will be great…
Linking Executable - user\objchk_wxp_x86\i386\scanuser.exe for i386
errors in directory d:\winddk\3790.1830\src\filesys\minifilter\scanner\user
user\scanuser.obj : error LNK2019: unresolved external symbol xxxxx@16ref
erenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol xxxxx@16ref
erenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__accept@12 r
eferenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
xxxxx@8 re
ferenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__closesocket
@4 referenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol xxxxx@12ref
erenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol xxxxx@4ref
erenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__inet_addr@4
referenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__WSACleanup@
0 referenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__WSAGetLastE
xxxxx@0 referenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__socket@12 r
eferenced in function _Setup@0
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__WSAStartup@
8 referenced in function _Setup@0
user\objchk_wxp_x86\i386\scanuser.exe : error LNK1120: 12 unresolved
externals
BUILD: Done

And you included the appropriate winsock headers and added the lib to
the sources file?

Shreyas Srivatsan wrote:

I am getting the following linker error…
The required lib and dlls are present and the path also i have set
properly. How do i get arnd this? When i got this same error while
working on a visual c project i simply added the lib file to the proj.
What can i do in this case and how??
Any help will be great…
Linking Executable - user\objchk_wxp_x86\i386\scanuser.exe for i386
errors in directory
d:\winddk\3790.1830\src\filesys\minifilter\scanner\user
user\scanuser.obj : error LNK2019: unresolved external symbol
__imp__send@16 <mailto: imp send> ref
> erenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp recv@16 <mailto: imp recv> ref
> erenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp accept@12 <mailto: imp accept> r
> eferenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp listen@8 <mailto: imp listen> re
> ferenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp closesocket
> @4 referenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp bind@12 <mailto: imp bind> ref
> erenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp htons@4 <mailto: imp htons> ref
> erenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp inet_addr@4 <mailto: imp inet_addr>
> referenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSACleanup@
> 0 referenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSAGetLastE
> rror@0 mailto:rror referenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp socket@12 <mailto: imp socket> r
> eferenced in function _Setup@0 mailto:_setup
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSAStartup@
> 8 referenced in function _Setup@0 mailto:_setup
> user\objchk_wxp_x86\i386\scanuser.exe : error LNK1120: 12 unresolved
> externals
> BUILD: Done
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</mailto:_setup></mailto:_setup></mailto: imp socket></mailto:_setup></mailto:rror></mailto:_setup></mailto:_setup></mailto: imp inet_addr></mailto:_setup></mailto: imp htons></mailto:_setup></mailto: imp bind></mailto:_setup></mailto:_setup></mailto: imp listen></mailto:_setup></mailto: imp accept></mailto:_setup></mailto: imp recv></mailto:_setup></mailto: imp send>

I had not added it to the source. Actually i was thinking how to do that as
i just changed a previous prog. Now done and its working.
Thanks.

Hi Shreyas;

There is a name decoration problems, and thats the reason the
linker is spitting out the errors. Do a depends on Winsock32.dll the
exported names are of the form “send” and not :__imp__send@16. Wrappers of
extern “C” will solve the problem. Or as matt pointed use the correct lib
files and headers for winsock

Thanks & Regards
Faraz.

On 6/7/06, MM wrote:
>
> And you included the appropriate winsock headers and added the lib to
> the sources file?
>
> Shreyas Srivatsan wrote:
>
> > I am getting the following linker error…
> > The required lib and dlls are present and the path also i have set
> > properly. How do i get arnd this? When i got this same error while
> > working on a visual c project i simply added the lib file to the proj.
> > What can i do in this case and how??
> > Any help will be great…
> > Linking Executable - user\objchk_wxp_x86\i386\scanuser.exe for i386
> > errors in directory
> > d:\winddk\3790.1830\src\filesys\minifilter\scanner\user
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp send@16 <mailto: imp send> ref
> > erenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp recv@16 <mailto: imp recv> ref
> > erenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp accept@12 <mailto: imp accept> r
> > eferenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp listen@8 <mailto: imp listen> re
> > ferenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp closesocket
> > @4 referenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp bind@12 <mailto: imp bind> ref
> > erenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp htons@4 <mailto: imp htons> ref
> > erenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp inet_addr@4 <mailto: imp inet_addr>
> > referenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp WSACleanup@
> > 0 referenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp WSAGetLastE
> > rror@0 mailto:rror referenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp socket@12 <mailto: imp socket> r
> > eferenced in function _Setup@0 mailto:_setup
> > user\scanuser.obj : error LNK2019: unresolved external symbol
> > imp WSAStartup@
> > 8 referenced in function _Setup@0 mailto:_setup
> > user\objchk_wxp_x86\i386\scanuser.exe : error LNK1120: 12 unresolved
> > externals
> > BUILD: Done
> > — Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> > List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></mailto:_setup></mailto:_setup></mailto: imp socket></mailto:_setup></mailto:rror></mailto:_setup></mailto:_setup></mailto: imp inet_addr></mailto:_setup></mailto: imp htons></mailto:_setup></mailto: imp bind></mailto:_setup></mailto:_setup></mailto: imp listen></mailto:_setup></mailto: imp accept></mailto:_setup></mailto: imp recv></mailto:_setup></mailto: imp send>

Faraz Ahmed wrote:

Hi Shreyas;

There is a name decoration problems, and thats the
reason the linker is spitting out the errors. Do a depends on
Winsock32.dll the exported names are of the form “send” and not
:__imp__send@16. Wrappers of extern “C” will solve the problem. Or as
matt pointed use the correct lib files and headers for winsock

Wrong. The linker never links to a DLL, so the spelling of the names in
ws2_32.dll is irrelevant. The linker links to a library, and if you go
examine the library, you’ll find that the entry point IS exactly
__imp__send@16. That symbol points to a linker record that makes a
reference to the “send” entry point in ws2_32.dll.

The imp things are quite normal. The C compiler produces that from
every __declspec(dllimport) name. C++ decoration problems produce very
different mangling.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Add wsock32.lib to the libraries section of the project settings.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

----- Original Message -----
From: “Shreyas Srivatsan”
To: “Windows System Software Devs Interest List”
Sent: Wednesday, June 07, 2006 9:54 AM
Subject: [ntdev] Linker Error

> I am getting the following linker error…
> The required lib and dlls are present and the path also i have set properly.
> How do i get arnd this? When i got this same error while working on a visual
> c project i simply added the lib file to the proj. What can i do in this
> case and how??
> Any help will be great…
> Linking Executable - user\objchk_wxp_x86\i386\scanuser.exe for i386
> errors in directory d:\winddk\3790.1830\src\filesys\minifilter\scanner\user
> user\scanuser.obj : error LNK2019: unresolved external symbol
xxxxx@16ref
> erenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
xxxxx@16ref
> erenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp accept@12 r
> eferenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> xxxxx@8 re
> ferenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp closesocket
> @4 referenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
xxxxx@12ref
> erenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
xxxxx@4ref
> erenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp inet_addr@4
> referenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSACleanup@
> 0 referenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSAGetLastE
> xxxxx@0 referenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp socket@12 r
> eferenced in function _Setup@0
> user\scanuser.obj : error LNK2019: unresolved external symbol
> imp WSAStartup@
> 8 referenced in function _Setup@0
> user\objchk_wxp_x86\i386\scanuser.exe : error LNK1120: 12 unresolved
> externals
> BUILD: Done
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

> Wrong. The linker never links to a DLL, so the spelling of the names in

ws2_32.dll is irrelevant. The linker links to a library, and if you go
examine the library, you’ll find that the entry point IS exactly
__imp__send@16. That symbol points to a linker record that makes a

wsock32.lib is the correct library.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com