[libstdc++/3052] 3.0 unresolved ref to sqrtf

Wolfgang Bangerth wolfgang.bangerth@iwr.uni-heidelberg.de
Wed Jul 11 05:45:00 GMT 2001


While the problem for the functions with floats has apparently been fixed
with present 3.0.1 CVS, it persists for long double functions. For the
appended small file I get linker errors complaining about missing
functions sqrtl, cosl and sinl.

Fix: probably just like for sqrtf, cosf and sinf.

Regards
  Wolfgang

var/gcc-bugs> cat b.cc
#include <cmath>
int main () {
  long double d;
  std::sqrt(d);
  std::cos(d);
  std::sin(d);
};

var/gcc-bugs> c++ b.cc
/var/tmp/cc0DGVwA.o: In function `std::cos(long double)':
/var/tmp/cc0DGVwA.o(.gnu.linkonce.t._ZSt3cose+0x2c): undefined reference
to `cosl'
/var/tmp/cc0DGVwA.o: In function `std::sin(long double)':
/var/tmp/cc0DGVwA.o(.gnu.linkonce.t._ZSt3sine+0x2c): undefined reference
to `sinl'
/var/tmp/cc0DGVwA.o: In function `std::sqrt(long double)':
/var/tmp/cc0DGVwA.o(.gnu.linkonce.t._ZSt4sqrte+0xb8): undefined reference
to `sqrtl'
collect2: ld returned 1 exit status

var/gcc-bugs> c++ -v
Reading specs from
/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss/lib/gcc-lib/sparc-sun-solaris2.7/3.0.1/specs
Configured with: ../gcc/configure
--prefix=/home/people/wolf/Config/sparc-sun-solaris2.7/gcc-ss
--with-gnu-ld --with-gnu-as --with-ld=/usr/local/bin/ld
--with-as=/usr/local/bin/as
Thread model: posix
gcc version 3.0.1 20010710 (prerelease)


-------------------------------------------------------------------------
Wolfgang Bangerth          email: wolfgang.bangerth@iwr.uni-heidelberg.de
                             www: http://gaia.iwr.uni-heidelberg.de/~wolf




More information about the Gcc-bugs mailing list