I have a library (commoncpp2) which defines the symbol
_XOPEN_SOURCE (automatically by configure-script)
When including <cmath> the compiler reports:
In file included from bug.cpp:7:
function `float std::acos(float)':
acosf' undeclared (first use here)
... and a lot more error messages about
undefined float functions
System: FreeBSD ws-ew-3.demig 4.6-STABLE FreeBSD 4.6-STABLE #6: Mon Aug 12 08:56:03 CEST 2002 firstname.lastname@example.org:/usr/src/sys/compile/WSEW3 i386
configured with: ./..//gcc-3.1.1/configure --disable-nls --with-gnu-as --with-gnu-ld --with-gxx-include-dir=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.6/3.1.1/include/g++-v3 --with-system-zlib --includedir=/usr/local/lib/gcc-lib/i386-portbld-freebsd4.6/3.1.1/include/Java --enable-shared --enable-threads --enable-threads=posix --prefix=/usr/local i386-portbld-freebsd4.6
see enclosed file bug.cpp
math.h as fixincluded from freebsd's /usr/include contains this:
#if ! defined (_XOPEN_SOURCE)
... definition of float functions
cmath contains this:
extern acosf() ...
Either FreeBSD's math.h is wrong in assuming that the float functions do not conform to xopen or the symbol _GLIBC_HAVE_ACOSF should
be defined differently.
BTW: the float functions DO exist in libc.so.
State-Changed-Why: This is a well-known issue (and not just with FreeBSD). Although (1) it is a bug with the configure script itself to test for "feature macros" in a different context than will be used, (2) it is a libstdc++-v3 bug to not adapt to visibility of the underlying libc. I have assigned myself (and left it open) since I am reworking this aspect of the C++ library. I suspect that even after I fix (2), (1) will still present a problem
for some software packages.
I can confirm that this bug still exists in 3.2.2 and mainline. Thanks for
State-Changed-Why: Patch on mainline (will be in 3.4). Not a regression from any 3.0 release.
State-Changed-Why: Reopen: Since in stage 3 for 3.3 branch, real bug fixes are still OK
even if not regression from past release. Fix will be moved to the
3.3 branch as soon as tested in that context.
State-Changed-Why: Patch applied to 3.3 branch.
*** Bug 10993 has been marked as a duplicate of this bug. ***