This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
compilation error: lround undeclared
- From: yue-feng sun <sunyf at ldeo dot columbia dot edu>
- To: gcc-bugs at gcc dot gnu dot org
- Cc: sunyf at ldeo dot columbia dot edu
- Date: Fri, 12 Jul 2002 14:45:44 -0400 (EDT)
- Subject: compilation error: lround undeclared
- Reply-to: yue-feng sun <sunyf at ldeo dot columbia dot edu>
Hi All,
The gcc version is
$ rpm -a -q | grep -i gcc
gcc-g77-2.96-110
gcc-2.96-110
gcc-objc-2.96-110
gcc-c++-2.96-110
gcc-java-2.96-110
system: Intel P4 i686, RedHat Linux 7.3 Linux Kernel 2.4.18-3
Error:
/usr/lib/gcc-lib/i386-redhat-linux/2.96/cc1plus /tmp/ccoartm5.ii -quiet
-dumpbase cppmain.C -O3 -Wunused -version -funroll-all-loops
-fexpensive-optimizations -o /tmp/ccQpUKf6.s
GNU C++ version 2.96 20000731 (Red Hat Linux 7.3 2.96-110) (i386-redhat-linux)
compiled by GNU C version 2.96 20000731 (Red Hat Linux 7.3 2.96-110).
cppmain.C: In function `void int_round ()':
cppmain.C:43: `lround' undeclared (first use this function)
cppmain.C:43: (Each undeclared identifier is reported only once for
each function it appears in.)
make[2]: *** [cppmain.o] Error 1
I had #include <math.h> in the C++ program cppmain.C and
used the math function lround(double).
math functions like atan are ok but not lround, floor, etc.
However, the code written in c instead of C++ is ok.
Is this a bug or I didn't have the correct include header for additional
C++ extra?
Thanks,
Sun