Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking errors of socket functions

Status
Not open for further replies.

Tanor

Programmer
Aug 9, 2004
2
US
I am currently getting 33 linking errors like the following:

c:\msvc\mfc\lib\lafxcwd.lib(sockcore.cpp) : error L2029: 'WSAASYNCSELECT' : unresolved external
c:\msvc\mfc\lib\lafxcwd.lib(sockcore.cpp) : error L2029: 'GETHOSTBYNAME' : unresolved external
c:\msvc\mfc\lib\lafxcwd.lib(sockcore.cpp) : error L2029: 'WSASTARTUP' : unresolved external

in each one is a different socket function. Each function listed in the errors appears nowhere in my program. I know that there has to be one thing that will make them all go away. can anyone help?

thanks,
Tanor
 
This is because you need to link with the winsock library. Below your #include lines, you can put
#pragma comment(lib, "ws2_32.lib") // winsock2 lib
or you can go to the project options and add that library to the linker section.
 
Thanks a lot...that took care of a big chunck of the errors....theres still a few based on socket functions that I do use in my program...theyre still linking errors:

ORSDC.OBJ(v:\source\ors\orsdc.cpp) : error L2029: 'public: void __far __pascal CSokSO::prepareToReceive(void)__far' : unresolved external
ORS.OBJ(v:\source\ors\ors.cpp) : error L2029: 'public: int __far __pascal CSokSO::Connect(char const __far*,unsigned int,int)__far' : unresolved external
ORS.OBJ(v:\source\ors\ors.cpp) : error L2029: 'public: virtual __far __pascal CSokSO::~CSokSO(void)__far' : unresolved external
ORSDC.OBJ(v:\source\ors\orsdc.cpp) : error L2029: 'public: void __far __pascal CSokSO::ReceiveImmediate(struct HWND__ const __near*,void __far*,int)__far' : unresolved external
ORSDC.OBJ(v:\source\ors\orsdc.cpp) : error L2029: 'public: void __far __pascal CSokSO::SendData(int,void __far*,int)__far' : unresolved external
ORS.OBJ(v:\source\ors\ors.cpp) : error L2029: 'public: __far __pascal CSokSO::CSokSO(int)__far' : unresolved external

what could be causing this?
 
It looks like you're not linking all necessary object and/or library files. Since this is a custom (it appears) class, I can't really tell you what files you need to link against. Are there any more files which should be included in your project to be linked against?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top