Mahen 0 Junior Poster

Hi everyone,
First of all thank you very much for all the help that you have been providing me. Unfortunately, i am hist with another bug. This time, i am havinh problems linking OBJ files that uses the following:

#include <stdio.h>
#include <winsock2.h>
#pragma comment(lib, "ws2_32")

When i link them, i get the following errors:

C:\lcc\bin>lcclnk wgate.obj
wgate.obj .text: undefined reference to '_socket@12'
wgate.obj .text: undefined reference to '_send@16'
wgate.obj .text: undefined reference to '_recv@16'
wgate.obj .text: undefined reference to '_WSAGetLastError@0'
wgate.obj .text: undefined reference to '_htons@4'
wgate.obj .text: undefined reference to '_inet_addr@4'
wgate.obj .text: undefined reference to '_gethostbyname@4'
wgate.obj .text: undefined reference to '_connect@12'
wgate.obj .text: undefined reference to '_WSAStartup@8'
wgate.obj .text: undefined reference to '_WSACleanup@0'

N.B: I use the LCC compiler and linker on windowsXP.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.