Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

link error LNK2019

21 views
Skip to first unread message

Paul Li via .NET 247

unread,
May 23, 2005, 3:02:40 PM5/23/05
to
------ Build started: Project: VESTA_SOAP, Configuration: Debug Win32 ------

Compiling...
VESTA_SOAP.cpp
Linking...
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function _main
VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _main
MSVCRTD.lib(wcrtexew.obj) : error LNK2019: unresolved external symbol _wWinMain@16 referenced in function _wWinMainCRTStartup
Debug/TEST_SERVER.exe : fatal error LNK1120: 12 unresolved externals

Build log was saved at "file://c:\Documents and Settings\00206518\My Documents\My Win32\Vesta_soap\Debug\BuildLog.htm"
VESTA_SOAP - 13 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped


--------------------------------
From: Paul Li

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>SzZZMcXd1UySrpeZ8a0sDA==</Id>

Jochen Kalmbach [MVP]

unread,
May 23, 2005, 3:29:05 PM5/23/05
to
Hi Paul!

> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__closesocket@4 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__send@16 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__recv@16 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__accept@12 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__listen@8 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__bind@12 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__htonl@4 referenced in function _main
> VESTA_SOAP.obj : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _main
> MSVCRTD.lib(wcrtexew.obj) : error LNK2019: unresolved external symbol _wWinMain@16 referenced in function _wWinMainCRTStartup
> Debug/TEST_SERVER.exe : fatal error LNK1120: 12 unresolved externals
>
> Build log was saved at "file://c:\Documents and Settings\00206518\My Documents\My Win32\Vesta_soap\Debug\BuildLog.htm"
> VESTA_SOAP - 13 error(s), 0 warning(s)

Please add the following to one of your source-file:

#pragma comment(lib, "Ws2_32.lib")

or you can add this lib (Ws2_32.lib) to the linker settings...

You also should change the subsystem in your linker settings from
"WINDOWS" to "CONSOLE" (I assume that you have a "_tmain" instead of a
"_tWinMain").

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/

Paul

unread,
Jun 1, 2005, 12:34:22 PM6/1/05
to
Hi Jochen,

Congrats on your MVP award.

I am indeed using _tmain and I set the linker settings to CONSOLE.
I also added lib (Ws2_32.lib) to the linker settings. But I still
getting the following error.

LIBCMTD.lib(wwincrt0.obj) : error LNK2019: unresolved external


symbol _wWinMain@16 referenced in function _wWinMainCRTStartup

Debug/TEST_SERVER.exe : fatal error LNK1120: 1 unresolved externals

Should I have the entry point set to wWinMainCRTStartup in the
linker settings? Your help would be greatly appreciated.

Thanks,
Paul.
--
POST BY: http://www.dotNET.us - Need .NET? Just ask, Please dotNET.us

Jochen Kalmbach [MVP]

unread,
Jun 2, 2005, 2:01:51 AM6/2/05
to
Hi Paul!

> I am indeed using _tmain and I set the linker settings to CONSOLE.
> I also added lib (Ws2_32.lib) to the linker settings. But I still
> getting the following error.
>
> LIBCMTD.lib(wwincrt0.obj) : error LNK2019: unresolved external
> symbol _wWinMain@16 referenced in function _wWinMainCRTStartup
> Debug/TEST_SERVER.exe : fatal error LNK1120: 1 unresolved externals

Maybe you have defined "_WINDOWS" in your preprocessor-definitions?
Be sure that you have "CONSOLE" in your linker-sybsystem!

Mitul Golakiya

unread,
Jul 25, 2009, 3:18:46 AM7/25/09
to
I had the same problem like this problem.

I have add below line to my source file and I have solve this.

#pragma comment(lib, "Ws2_32.lib")

You should try this.

url:http://www.ureader.com/msg/145357.aspx

0 new messages