From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.0 (X11; Linux i686; U;) Gecko/20020311 Description of problem: Then i compilling program with function round() for example, the compiller generate error: `round' undeclared (first use this function). With g++3 all ok but with g++ - we have error :( Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: type program such this: #include <stdio.h> #include <math.h> #include <printf.h> int main() { printf("Its integer:%i\n",(int)round(6.99999)); } Save it as testmat.cpp then use: g++ testmat.cpp -o testmat -lm Actual Results: [slava@maze PrintTest]$ g++ -Wall testmat.cpp -o testmat -lm testmat.cpp: In function `int main ()': testmat.cpp:10: `round' undeclared (first use this function) testmat.cpp:10: (Each undeclared identifier is reported only once for each function it appears in.) Expected Results: use g++3 -Wall testmat.cpp -o testmat -lm All ok. Why ? Additional info: Please, help with this if you can :(
It is because round(3) is available only in the ISO C99 feature set (see features.h and info libc for information about feature macros). Try g++ -D_ISOC99_SOURCE or g++ -D_GNU_SOURCE It works with g++3 because it hardcodes -D_GNU_SOURCE ATM.