First .....
I wrote a Dialog Based Win32 application to download a web page from a site.
I wrote all of the sockets code directly in main.c
I include: <winsock.h>
That program works well.
Next...
I wrote a simple function that loops and counts up with an internal while() at once/sec and updates a dialog edit box.
I ran that function as a background thread and that program runs fine, counting up, updating the edit dialog once per sec.
Finally ....
I took the working sockets code and put it into the function that runs in the background and I get POLINK Unresolved External error for all of the sockets calls.
My function is declared as:
void __cdecl th02(void* pParam)
I start the background thread with:
int n = 123;
beginthread(&th02, 0, &n);
The error messages are:
POLINK: error: Unresolved external symbol '_WSAStartup@8'.
POLINK: error: Unresolved external symbol '_gethostbyname@4'.
POLINK: error: Unresolved external symbol '_socket@12'.
POLINK: error: Unresolved external symbol '_inet_ntoa@4'.
POLINK: error: Unresolved external symbol '_inet_addr@4'.
POLINK: error: Unresolved external symbol '_htons@4'.
POLINK: error: Unresolved external symbol '_connect@12'.
POLINK: error: Unresolved external symbol '_send@16'.
POLINK: error: Unresolved external symbol '_recv@16'.
POLINK: error: Unresolved external symbol '_closesocket@4'.
POLINK: error: Unresolved external symbol '_WSACleanup@0'.
POLINK: fatal error: 11 unresolved external(s).
Any help in understanding my error here is much appreciated.
Thanks,
Rob