#1291 duplicate symbols when using several powf calls with -O0

OTHER
closed
nobody
gcc (462)
out-of-date
Unknown
2013-01-29
2009-05-15
No

When using several powf calls in different compilation units, and building a debug build with -O0 and using C++ mingw compiler, the object code is created for each powf call. This leads to duplicate symbols when linking.
The function definition in math.h is:
__CRT_INLINE float __cdecl powf (float x, float y)
{return (float) pow (x, y);}
When using the overloaded pow from cmath, everything works well. The cmath that comes with mingw uses builtins for that particular overloaded pow:
inline float
pow(float __x, float __y)
{ return __builtin_powf(__x, __y); }
I don't know what is the proper fix, maybe call the builtin in the math.h header too?

Discussion

  • Earnie Boyd

    Earnie Boyd - 2012-06-14
    • status: open --> closed-out-of-date
     
  • Earnie Boyd

    Earnie Boyd - 2012-06-14

    This appears to be a user issue to me but if you are still experiencing problems with a current release open a new issue.

     
  • Earnie Boyd

    Earnie Boyd - 2013-01-29
    • labels: mingw runtime (deprecated use WSL) --> gcc
    • status: closed-out-of-date --> closed
    • resolution: --> out-of-date
    • category: --> Unknown
    • milestone: --> OTHER
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks