[ee122] compile questions for proj1

Jawwad jawwadmemon at berkeley.edu
Sun Sep 16 21:55:30 PDT 2007


You need to add two flags so gcc http_client -lsocket -nsl. This will do it

-Jawwad

-----Original Message-----
From: ee122-bounces at ICSI.Berkeley.EDU
[mailto:ee122-bounces at ICSI.Berkeley.EDU] On Behalf Of abhishekd at berkeley.edu
Sent: Sunday, September 16, 2007 9:52 PM
To: ee122 at ICSI.Berkeley.EDU
Subject: [ee122] compile questions for proj1

Hi,

So I don't exactly understand how to compile the client file I have been
working on so far. Either that or my includes are messed up...I keep
getting the following error when doing gcc -g -Wall -std=c99 -o
http_client.o client.c   client.h

Undefined                       first referenced
 symbol                             in file
gethostbyname                       /var/tmp//cckWfo1l.o
socket                              /var/tmp//cckWfo1l.o
connect                             /var/tmp//cckWfo1l.o


My includes are as follows:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <netdb.h>

That may be more includes than I need...I probably have some simple error
that needs to be fixed but am stuck at the moment and can't really
progress without solving this issue...

Thanks for your help
Abhishek Doshi

_______________________________________________
ee122 mailing list
ee122 at mailman.ICSI.Berkeley.EDU
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122



More information about the ee122 mailing list