Opened 13 years ago

Closed 13 years ago

#460 closed defect (invalid)

multiple definition of `_SDL_GetError'

Reported by: Kyle Owned by:
Priority: critical Component: build system
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


When trying to compile the latest FFmpeg with MinGW-w64 with SDL support I get:
multiple definition of `_SDL_GetError'
libavdevice/libavdevice.dll.a(d000060.o):(.text+0x0): first defined here
multiple definition of `_SDL_CreateThread'
libavdevice/libavdevice.dll.a(d000030.o):(.text+0x0): first defined here
multiple definition of `_SDL_WaitThread'
libavdevice/libavdevice.dll.a(d000168.o):(.text+0x0): first defined here

More information about this bug can be found at: along with a possible solution found at:

I gave this bug critical priority because it is effecting the build processes.

Change History (5)

comment:1 by Carl Eugen Hoyos, 13 years ago

Status: newopen
Version: gitgit-master

What works fine for me is:
Building ffmpeg and ffplay (etc.) with shared libraries for win64 on msys with SDL support. If this is not what you wanted to achieve, please explain.

Since I have no idea what you tried (to achieve mentioned goal), I will try to sum up what I did (already having a working msys installation that allows to build 32 bit Win32 applications with mingw32):

  • Installed MinGW64 into C:\mingw64
  • Added a symlink from /c/mingw64/bin/x86_64-w64-mingw32-gcc.exe to /c/mingw64/bin/gcc.exe (effectively copying the file, afaict the gcc binary in /c/mingw64/x86_64-w64-mingw32/bin does not work since gcc expects not to be copied in another directory than the installation directory)
  • Added /c/mingw64/bin and /c/mingw64/x86_64-w64-mingw32/bin (in his order!) in front of my PATH
  • Downloaded SDL 1.2.14, untared it and configured with --prefix=/c/mingw64
  • Removed build/version.o from the Makefile (windres seems unable to produce a win64 file)
  • Built and installed SDL
  • Cloned latest FFmpeg git
  • Configured with --enable-shared --disable-static, built and tested it from both within msys and the windows cmd shell setting an appropriate PATH in both cases. (Also successfully tested ./configure, i.e. static compilation.)

What works is ./ffmpeg -i tests/lena.pnm out.jpg && ./ffplay out.jpg

This is on Vista 64, I believe the only thing I ever installed except msys, mingw32, mingw64 and a 32bit SDL binary is yasm.exe in /bin. I have neither pkg-config nor lib.exe.

comment:2 by Carl Eugen Hoyos, 13 years ago

PS: I believe the dxva2 test in configure does not work correctly, I will send a patch.

in reply to:  2 comment:3 by Kyle, 13 years ago

Your building with mingw(mingw32) on a native compile system (on Windows). I'm cross compile (on Linux) with a different package, mingw-w64.

comment:4 by Kyle, 13 years ago

This issue can be resolved by compiling SDL with -DDECLSPEC= added to the CFLAGS.

Bug resolved.

comment:5 by Carl Eugen Hoyos, 13 years ago

Resolution: invalid
Status: openclosed

Thank you for the analysis!

Note: See TracTickets for help on using tickets.