> -----Original Message----- > From: Brandon > Sent: Wednesday, 4 June 2008 2:15 a.m. > To: [EMAIL PROTECTED] > Subject: Bug#484299: Can not use powf and sinf in the same project. > > > Package: mingw32-runtime > Version: 3.13-1 > Severity: normal > > A project which attempts to use both powf and sinf will fail to link > with mingw. It links fine with gcc, assuming that the math library is > linked in with -lm. Here is sample code which will fail: > > --- Begin sample code --- > #include <cmath> > > int main(int argc, char ** argv) > { > float x = 2.0f, y = 3.0f, z; > > z = powf(x, y); > x = sinf(z); > return 0; > } > --- End --- > > The error message is: > /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/libstdc++.a(stubs.o): > (.text+0x160): > multiple definition of > `_powf' /tmp/ccgqbZdX.o:tmp.cpp:(.text$powf[_powf]+0x0): first defined > here collect2: ld returned 1 exit status > > If you comment out either z = powf..., or x = sinf..., this program > will build just fine. As a side note, I think it has taken me > more than > a day to diagnose this bug. It's been a big PITA. > > -Brandon
This is a cross-compile bug in libstdc++. math/stubs.o should be empty. Please file a bug report with gcc bugzilla. Danny -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]