Winsock linking problems 
Author Message
 Winsock linking problems

I am just trying to learn how to use Windows sockets as I
have till now porgrammed only on Linux. I am trying to run
a very basic TCP server code from the Pocket Guide to
TCP/IP website. I am able to compile the code but unable to
link and build the executable because the linker is not
able to find code for winsock functions like ntoa and
listen etc. For example this is one of the linker errors.

tcp_sock_s error LNK2019: unresolved external symbol

I have included winsock.h and the options for the
directories contain the place where winsock.dll is located.
What am I doing wrong here?



Fri, 14 Jan 2005 14:37:15 GMT  
 Winsock linking problems

in project setting, in the link options, you have to add "ws2_32.lib" to the
project. You include the header file to reference to it, but the
implemention has not yet put into your executable before your link with the
lib. Change your header file to winsock2.h instead, don't include old header
file.


Quote:
> I am just trying to learn how to use Windows sockets as I
> have till now porgrammed only on Linux. I am trying to run
> a very basic TCP server code from the Pocket Guide to
> TCP/IP website. I am able to compile the code but unable to
> link and build the executable because the linker is not
> able to find code for winsock functions like ntoa and
> listen etc. For example this is one of the linker errors.

> tcp_sock_s error LNK2019: unresolved external symbol

> I have included winsock.h and the options for the
> directories contain the place where winsock.dll is located.
> What am I doing wrong here?



Fri, 14 Jan 2005 15:08:59 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Problem linking 16bit winsock app

2. Winsock Winsock Winsock !!!

3. Winsock - compiling, not linking!

4. linking errors: MFC and Winsock 2

5. Link errors on a winsock app

6. Winsock OXC vs.Winsock DLL

7. Linking problem: strncasecmp can not be linked

8. linking problem (link bug?)

9. Winsock compile problem

10. problems with structs in Winsock 2

11. winsock tcp server problem

12. winsock problem

 

 
Powered by phpBB® Forum Software