We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3979

Summary: Failed to link with "multiple definition of `scalbln'" error on both MinGW and MinGW-w64 by CMake
Product: SDL Reporter: Vitaly Novichkov <admin>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2    
Version: HG 2.1   
Hardware: All   
OS: Windows (All)   

Description Vitaly Novichkov 2017-11-24 10:05:00 UTC
Hello!

Once I ran build of my codecs collection on AppVeyor where my CMake script downloads latest SDL2 from HG repo, failed to link because of math functions conflict:

https://ci.appveyor.com/project/Wohlstand/audiocodecs/build/1.0.44
The revision is b94292eebb5c

There are both vanilla MinGW and MinGW-w64 are failed to build.


```
[100%] Linking C shared library libSDL2.dll
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../libmingwex.a(scalbn.o):(.text+0x0): multiple definition of `scalbln'
CMakeFiles\SDL2.dir/objects.a(s_scalbn.c.obj):C:/projects/audiocodecs/build-MinGW-Release-Win32/external/SDL2/src/SDL2HG/src/libm/s_scalbn.c:30: first defined here
collect2.exe: error: ld returned 1 exit status
CMakeFiles\SDL2.dir\build.make:3678: recipe for target 'libSDL2.dll' failed
mingw32-make.exe[5]: *** [libSDL2.dll] Error 1
CMakeFiles\Makefile2:140: recipe for target 'CMakeFiles/SDL2.dir/all' failed
mingw32-make.exe[4]: *** [CMakeFiles/SDL2.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make.exe[3]: *** [all] Error 2
CMakeFiles\SDL2HG.dir\build.make:112: recipe for target 'external/SDL2/src/SDL2HG-stamp/SDL2HG-build' failed
mingw32-make.exe[2]: *** [external/SDL2/src/SDL2HG-stamp/SDL2HG-build] Error 2
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/SDL2HG.dir/all' failed
mingw32-make.exe[1]: *** [CMakeFiles/SDL2HG.dir/all] Error 2
Makefile:128: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
```

Through autotools build on MinGW is fine.
Comment 1 Sam Lantinga 2017-11-24 11:01:24 UTC
Fixed, thanks!
https://hg.libsdl.org/SDL/rev/0083f778ede4