Re: programming in Red hat 7.2 include error without -O

2002-07-29 Thread John DeDourek
And with optimization, the compiler would discover that it can compute the sqrt at compile time and put the answer into the object code, which is why you don't need the sqrt routine linked in with optimization enabled. BTW, if this is a "time killer" program, the optimized version would run SIGNI

Re: programming in Red hat 7.2 include error without -O

2002-07-27 Thread Venkatesh Krishnamurthi
Hi, The "sqrt" function is in libm, you should use: gcc PROGRAM_NAME -lm Venkatesh > > Hi, all > > I had a function and cc it in redhat 7.2, > but if I use > $gcc PROGRAM_NAME, > there will be error : > > /tmp/ccAXzZTF.o: In function `main': > /tmp/ccAXzZTF.o(.text+0x32): undefined referen

programming in Red hat 7.2 include error without -O

2002-07-27 Thread Jerry Chou
Hi, all I had a function and cc it in redhat 7.2, but if I use $gcc PROGRAM_NAME, there will be error : /tmp/ccAXzZTF.o: In function `main': /tmp/ccAXzZTF.o(.text+0x32): undefined reference to `sqrt' collect2: ld returned 1 exit status but if I use -O or -O2 to gcc, it works well !! I do not kn