Compiling windows socket application.

I'm trying to compile and link a small Windows socket application, but when I fo this i get the following errors:

D:Tempcc6Tcaaa.o(.text+0xfb)://D/C/ClientSocket/clientsocket.c: undefined reference to `WSAStartup@8'
D:Tempcc6Tcaaa.o(.text+0x12d)://D/C/ClientSocket/clientsocket.c: undefined reference to `gethostbyname@4'
D:Tempcc6Tcaaa.o(.text+0x16a)://D/C/ClientSocket/clientsocket.c: undefined reference to `socket@12'
D:Tempcc6Tcaaa.o(.text+0x1ab)://D/C/ClientSocket/clientsocket.c: undefined reference to `htons@4'
D:Tempcc6Tcaaa.o(.text+0x1fb)://D/C/ClientSocket/clientsocket.c: undefined reference to `connect@12'
D:Tempcc6Tcaaa.o(.text+0x235)://D/C/ClientSocket/clientsocket.c: undefined reference to `send@16'
D:Tempcc6Tcaaa.o(.text+0x24c)://D/C/ClientSocket/clientsocket.c: undefined reference to `recv@16'
D:Tempcc6Tcaaa.o(.text+0x2a6)://D/C/ClientSocket/clientsocket.c: undefined reference to `WSACleanup@0'

Bewerking afgesloten het fout-code 1

I'm using the MinGW C compiler on Windows 2000.
Could anyone tell me what I'm doing wrong?

Thank You

Comments

  • Link libws2_32.a with -lws2_32.
  • : Link libws2_32.a with -lws2_32.
    :
    At the risk of sounding stupid... how do i do that?


  • Since I am unable to use Dev C++ at the moment this will be somewhat vague: Find a project settings dialog, and place -lws2_32 in the 'linking options' or 'compiler options' text box.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories