Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Oliver Elphick
On Tue, 2006-02-14 at 10:54 -0600, Matt Zagrabelny wrote: > > hmmm, have you tried to add the "-lm" ??? > > i was thinking the same, but it looks as though he is only compiling, > not linking, so one would think that '-lm' would have no impact. That's right; the -c option was used. This is just

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Matt Zagrabelny
On Tue, 2006-02-14 at 09:40 -0600, Sergio Cuéllar Valdés wrote: > 2006/2/14, Oliver Elphick : > > I am trying to use the math function round() according to the manpage, > > but it does not compile. Can anyone explain why not, please? > > The command line and error are: > > > > g++-2.95 -c -pipe -D

Re: C++: Math function round() does not compile - why? - resolution

2006-02-14 Thread Oliver Elphick
On Tue, 2006-02-14 at 15:15 +0100, Jan C. Nordholz wrote: > Hi, > > > with g++-2.95, this gives no prototypes for round(). > > > > So it appears that -std=c99 does not work. Is there some way to achieve > > this for 2.95? (This is now academic, since I have written my own > > version for this ap

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Kevin B. McCarty
Oliver Elphick wrote: > On Tue, 2006-02-14 at 14:11 +0100, Jan C. Nordholz wrote: >> Hi Oliver, >> >> > g++-2.95 -c -pipe -DQWS -fexceptions -fno-rtti -Wall -W -g -std=c99 >> > -I/opt/Qtopia/include -o orderimpl.o orderimpl.cpp >> > orderimpl.cpp: In method `void OrderImpl::calculate_line(int)':

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Sergio Cuéllar Valdés
2006/2/14, Oliver Elphick : > I am trying to use the math function round() according to the manpage, > but it does not compile. Can anyone explain why not, please? > The command line and error are: > > g++-2.95 -c -pipe -DQWS -fexceptions -fno-rtti -Wall -W -g -std=c99 > -I/opt/Qtopia/include -o

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Jan C. Nordholz
Hi, > with g++-2.95, this gives no prototypes for round(). > > So it appears that -std=c99 does not work. Is there some way to achieve > this for 2.95? (This is now academic, since I have written my own > version for this application.) you could use the "features" header. Start your source file

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Oliver Elphick
On Tue, 2006-02-14 at 14:11 +0100, Jan C. Nordholz wrote: > Hi Oliver, > > > g++-2.95 -c -pipe -DQWS -fexceptions -fno-rtti -Wall -W -g -std=c99 > > -I/opt/Qtopia/include -o orderimpl.o orderimpl.cpp > > orderimpl.cpp: In method `void OrderImpl::calculate_line(int)': > > orderimpl.cpp:84: implici

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Jan C. Nordholz
Hi Oliver, > g++-2.95 -c -pipe -DQWS -fexceptions -fno-rtti -Wall -W -g -std=c99 > -I/opt/Qtopia/include -o orderimpl.o orderimpl.cpp > orderimpl.cpp: In method `void OrderImpl::calculate_line(int)': > orderimpl.cpp:84: implicit declaration of function `int round(...)' this sounds like doesn't

Re: C++: Math function round() does not compile - why?

2006-02-14 Thread Thomas Jollans
On Tuesday 14 February 2006 11:48, Oliver Elphick wrote: > [snip] > sprintf(tmp, "%.4f", round((double) newqty * price * discpc) / 100.); > [snip] > orderimpl.cpp:84: implicit declaration of function `int round(...)' this is indeed wierd. %.4f should expect a double, not an int. You could try %