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 - Failed to link with "multiple definition of `scalbln'" error on both MinGW and MinGW-w64 by CMake
Summary: Failed to link with "multiple definition of `scalbln'" error on both MinGW an...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: HG 2.1
Hardware: All Windows (All)
: P2 critical
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-24 10:05 UTC by Vitaly Novichkov
Modified: 2017-11-24 11:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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