This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help requested in using gcc 2.95


hint: -lsocket


On Fri, 31 Oct 2003, Gaurav Singh wrote:

> Hi
> I have written only these 2 lines of code
> When I try to compile the program It gives the error as described
>
> Can you pleease help me
>
> Thankx in advance
> Gaurav
>
>
> #include <sys/types.h>
> #include <sys/socket.h>
> #include <netinet/in.h>
> #include <arpa/inet.h>
> #include <netdb.h>
> #include <stdio.h>
> #include <unistd.h>
> #define SERVER_PORT 54203
> #define SERVER_NAME cs.babbage.iit.edu
>
> int main(int argc,char *argv[])
> {
>   int s;
>   s= socket(AF_INET,SOCK_STREAM,0);
>
>  return 0;
>
> }
> bash-2.03$ gcc -o Client ClientSocket.c
> Undefined                       first referenced
>  symbol                             in file
> socket                              /var/tmp/ccipJJFU.o
> ld: fatal: Symbol referencing errors. No output written to Client
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]