Chilkat VC++ Link Errors

Question:

I get these link errors when linking with the Chilkat VC++ library:

LINK : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAStartup@8 referenced in function "private: static bool __cdecl ChilkatSocket::startupWSA(class LogBase &)" (?startupWSA@ChilkatSocket@@CA_NAAVLogBase@@@Z)

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__WSAGetLastError@0 referenced in function "private: bool __thiscall ChilkatSocket::createSocket(class LogBase &)" (?createSocket@ChilkatSocket@@AAE_NAAVLogBase@@@Z)

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__socket@12 referenced in function "private: bool __thiscall ChilkatSocket::createSocket(class LogBase &)" (?createSocket@ChilkatSocket@@AAE_NAAVLogBase@@@Z)

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__gethostbyname@4 referenced in function "private: static bool __cdecl ChilkatSocket::CheckHostname2(char const *,int)" (?CheckHostname2@ChilkatSocket@@CA_NPBDH@Z)

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__inet_addr@4 referenced in function "private: static bool __cdecl ChilkatSocket::CheckHostname2(char const *,int)" (?CheckHostname2@ChilkatSocket@@CA_NPBDH@Z)

CkBaseDbgSt.lib(ChilkatSocket.obj) : error LNK2019: unresolved external symbol __imp__htons@4 referenced in function "private: static bool __cdecl ChilkatSocket::CheckHostname2(char const *,int)" (?CheckHostname2@ChilkatSocket@@CA_NPBDH@Z)

Answer:

There's a README.html file included with the distribution, which tells what additional Microsoft libraries need to be linked in. You should add these:

wininet.lib, rpcrt4.lib, crypt32.lib, ws2_32.lib

to your list of libs in your VC++ linker options.