Re: Simple c program won't compile

2001-03-06 Thread Juan Fuentes
* Chris Gray ([EMAIL PROTECTED]) wrote: > This is not. (Using "should" in the sense that it must be this way to > compile, not be this way to be stylistically correct). It is just > confusing to everyone else who reads his program to have it the way > that Mark has it. Traditionally, argc stands

Re: Simple c program won't compile

2001-03-06 Thread MaD dUCK
also sprach Xucaen (on Tue, 06 Mar 2001 10:36:15AM -0800): > > int main(int foo, char **bar, char **baz) > to be honest, I haven't seen this last one. how > does it work? the third argument is a pointer to a sequence of pointers to environment var=val pairs, terminated by a null pointer. martin

Re: Simple c program won't compile

2001-03-06 Thread Xucaen
--- Chris Gray <[EMAIL PROTECTED]> wrote: > vector". But they are just arguments to a > function and can have any > name a person wants. So all the following are > correct: > > int main(void) > int main(int foo, char **bar) > int main(int foo, char **bar, char **baz) > to be honest, I haven't s

Re: Simple c program won't compile

2001-03-06 Thread Chris Gray
On Mon, 05 Mar 2001, Juan Fuentes wrote: > * Mark Phillips ([EMAIL PROTECTED]) wrote: >> >> int main(int argv, char **argc){ > > Mark you need to link to math library: > > gcc -g thick.c -lm -o thick This is (of course) correct. > And main should be: > > int main(int argc, char **argv); This

Re: Simple c program won't compile

2001-03-05 Thread Xucaen
I think I will forget this for a while myself. also, when using ncurses.h, you need to compile with -lncurses . xucaen --- Mark Phillips <[EMAIL PROTECTED]> wrote: > I've just solved my own problem. Of course I > needed to do > > $ gcc thick.c -lm > > It's been a while since I've used C. S

Re: Simple c program won't compile

2001-03-05 Thread Bostjan Muller
* On 05-03-01 at 16:21 Bostjan Muller ([EMAIL PROTECTED]) wrote: +Here quoted text begins+ [...] +and here the quote ends+ Wow I was far off... hmm shows I'm still on day five of C in 21 days ;) B. -- Boštjan Müller [NEONATUS], [EMAIL PROTECTED], http://neonatus.net/~neonatus Fo

Re: Simple c program won't compile

2001-03-05 Thread Juan Fuentes
* Mark Phillips ([EMAIL PROTECTED]) wrote: > Hi, > > The following program: > > > #include > #include > > int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); > } > > > does not compile. Instead I get the errors: > > $ gcc thick.c > /tmp/ccU9fgSr.o: In function `main': > /tm

Re: Simple c program won't compile

2001-03-05 Thread Bostjan Muller
* On 05-03-01 at 15:23 Mark Phillips ([EMAIL PROTECTED]) wrote: +Here quoted text begins+ > Hi, > > The following program: > > > #include > #include > > int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); > } > > > does not compile. Instead I get the errors: > > $ g

Re: Simple c program won't compile

2001-03-05 Thread Anthony Fox
Mark Phillips <[EMAIL PROTECTED]> writes: > Hi, > > The following program: > > > #include > #include > > int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); > } > > > does not compile. Instead I get the errors: > > $ gcc thick.c > /tmp/ccU9fgSr.o: In function `main': > /tm

Re: Simple c program won't compile

2001-03-05 Thread Mike Moran
Mark Phillips wrote: > > Hi, > > The following program: > > #include > #include > > int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); > } > > does not compile. Instead I get the errors: > > $ gcc thick.c > /tmp/ccU9fgSr.o: In function `main': > /tmp/ccU9fgSr.o(.text+0x16):

Re: Simple c program won't compile

2001-03-05 Thread Erdmut Pfeifer
On Tue, Mar 06, 2001 at 12:26:30AM +1030, Mark Phillips wrote: > Hi, > > The following program: > > > #include > #include > > int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); > } > > > does not compile. Instead I get the errors: > > $ gcc thick.c > /tmp/ccU9fgSr.o: In fu

Re: Simple c program won't compile

2001-03-05 Thread Oliver Elphick
Mark Phillips wrote: >Hi, > >The following program: > > >#include >#include > >int main(int argv, char **argc){ > double x; > > x=sqrt(5.0); >} > > >does not compile. Instead I get the errors: > >$ gcc thick.c >/tmp/ccU9fgSr.o: In function `main': >/tmp/

Re: Simple c program won't compile

2001-03-05 Thread Ethan Benson
On Tue, Mar 06, 2001 at 12:26:30AM +1030, Mark Phillips wrote: > Hi, > does not compile. Instead I get the errors: > > $ gcc thick.c > /tmp/ccU9fgSr.o: In function `main': > /tmp/ccU9fgSr.o(.text+0x16): undefined reference to `sqrt' > collect2: ld returned 1 exit status > > > What is wrong? y

Re: Simple c program won't compile

2001-03-05 Thread Mark Phillips
I've just solved my own problem. Of course I needed to do $ gcc thick.c -lm It's been a while since I've used C. Sorry for the silly question. Cheers, Mark. Mark Phillips [EMAIL PROTECTED] wrote: > Hi, > > The following program: > > > #include > #include > > int main(int argv, char **