I wrote code in vc++ 6.0 to ping a server which works well but the same doesnt work in vc.net .
i tried with the following lib files
#pragma comment(linker,ws2_32)
ws2_32.lib
#pragma comment( linker, "/defaultlib:ws2_32.lib")
and i aslo included the winsock2.h
Could any one suggest me a solution
Andreas Masur
November 30th, 2004, 05:31 AM
Well...what does not work?
anand123
November 30th, 2004, 06:47 AM
the application is giving linking errors
Andreas Masur
November 30th, 2004, 06:50 AM
Well...what linker errors?
anand123
November 30th, 2004, 06:59 AM
error LNK2019: unresolved external symbol __imp__WSACleanup@0 referenced in function _WinMain@16
error LNK2019: unresolved external symbol __imp__gethostbyaddr@12 referenced in function _WinMain@16
error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function _WinMain@16
error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function _WinMain@16
these are linking errors i am getting when i execute the same code in vc.net,
Andreas Masur
November 30th, 2004, 08:59 AM
#pragma comment (lib, "ws2_32")
anand123
November 30th, 2004, 11:53 PM
i tried #pragma comment (lib, "ws2_32") but still i am getting the same errors
notyetguru
December 1st, 2004, 01:18 AM
hi,
i had the same linking problem with winsock32.dll. the code compiled fine, but i couldn't link to the mentioned dll -- unresolved externals on dll functions. couldn't find a solution
Andreas Masur
December 1st, 2004, 02:13 AM
Well...that is interesting...can you post a compilable sample program which recreates the error?
notyetguru
December 1st, 2004, 02:57 AM
Oiriginally posted by Andreas Masur
Well...that is interesting...can you post a compilable sample program which recreates the error?
Well, I don't have the source code of the program here (at my job). I tried to develop the client/server winsock based program some years ago when i was learning visual c++, it was for learning purposes only, and after getting the unresolved external errors i gave up after a while. i don't know if i still have the
source code on my home computer. however, the questions remain, since then
i wasn't confronted with internet socket programming again.