Using Sockets

  • Hello,
    Im working with a NetDCU10, and I'm triying to create a server-client communication to comunicate differents threads in my c++ code. I'm using sockets to do it, but they doesn't work. When I try to compile my code, these errors appear:


    1>ServerClient.obj : error LNK2019: unresolved external symbol listen referenced in function "public: void __cdecl ServerClient::ServerInit(int,int)" (?ServerInit@ServerClient@@QAAXHH@Z)
    1>ServerClient.obj : error LNK2019: unresolved external symbol bind referenced in function "public: void __cdecl ServerClient::ServerInit(int,int)" (?ServerInit@ServerClient@@QAAXHH@Z)
    1>ServerClient.obj : error LNK2019: unresolved external symbol htons referenced in function "public: void __cdecl ServerClient::ServerInit(int,int)" (?ServerInit@ServerClient@@QAAXHH@Z)
    1>ServerClient.obj : error LNK2019: unresolved external symbol socket referenced in function "public: void __cdecl ServerClient::ServerInit(int,int)" (?ServerInit@ServerClient@@QAAXHH@Z)


    I think that I need to include the library ws2_32.lib, but I don't know if it is available in WindowsCE... Anyone knows it or can help me?
    Thanks!

  • Hello,
    i think is should work if you include winsock.h (or winsock2.h) and link against winsock.lib.

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hello,
    i checked install dir of SDK and saw ws2.lib is also available!

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.