This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Help requested in using gcc 2.95
- From: Ishwar Rattan <ishwar at cps dot cmich dot edu>
- To: Gaurav Singh <singgau3 at iit dot edu>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 31 Oct 2003 19:17:49 -0500 (EST)
- Subject: Re: Help requested in using gcc 2.95
- References: <a25cc6a262aa.a262aaa25cc6@iit.edu>
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
>