Opened 13 years ago

Closed 13 years ago

#391 closed defect (invalid)

multiple definition of `_DXVA2_Fixed32OpaqueAlpha'

Reported by: Kyle Owned by: Michael Niedermayer
Priority: critical Component: avcodec
Version: git Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm getting the following error while trying to compile the latest FFmpeg with MinGW-w64:

libavcodec/libavcodec.a(dxva2_mpeg2.o):dxva2_mpeg2.c:(.text+0x7d0): multiple definition of `_DXVA2_Fixed32OpaqueAlpha'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1870): first defined here
libavcodec/libavcodec.a(dxva2_mpeg2.o):dxva2_mpeg2.c:(.text+0x7e0): multiple definition of `_DXVA2_Fixed32TransparentAlpha'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1880): first defined here
libavcodec/libavcodec.a(dxva2_mpeg2.o):dxva2_mpeg2.c:(.text+0x7f0): multiple definition of `_DXVA2FixedToFloat'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1890): first defined here
libavcodec/libavcodec.a(dxva2_mpeg2.o):dxva2_mpeg2.c:(.text+0x830): multiple definition of `_DXVA2FloatToFixed'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x18d0): first defined here
libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.text+0x170): multiple definition of `_DXVA2_Fixed32OpaqueAlpha'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1870): first defined here
libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.text+0x180): multiple definition of `_DXVA2_Fixed32TransparentAlpha'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1880): first defined here
libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.text+0x190): multiple definition of `_DXVA2FixedToFloat'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x1890): first defined here
libavcodec/libavcodec.a(dxva2.o):dxva2.c:(.text+0x1d0): multiple definition of `_DXVA2FloatToFixed'
libavcodec/libavcodec.a(dxva2_h264.o):dxva2_h264.c:(.text+0x18d0): first defined here
collect2: ld returned 1 exit status
make: *** [ffmpeg_g.exe] Error 1

make V=1 shows:

i686-w64-mingw32-gcc -Llibavcodec -Llibavdevice -Llibavfilter -Llibavformat -Llibavutil -Llibpostproc -Llibswscale -Wl,--as-needed -Wl,--warn-common -Wl,-rpath-link=libpostproc:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil -o ffmpeg_g.exe ffmpeg.o cmdutils.o -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswscale -lavutil -lavicap32 -lpsapi -lole32 -lstrmiids -luuid -lws2_32 -lm -lpthread -lpsapi

I'm using GCC 4.6.1 to compile, I believe the issue could be on MinGW-w64s end, but I'm not sure because I had no other issues compiling other software with the toolchain.

Attachments (1)

dxva2api.h (25.9 KB ) - added by Kyle 13 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 by Carl Eugen Hoyos, 13 years ago

Component: FFmpegavcodec
Status: newopen

Does it work without --enable-shared?

Am I correct that the problem is related to <dxva2api.h>? (Are the symbols in question defined there?)
If yes, could you attach the header?

by Kyle, 13 years ago

Attachment: dxva2api.h added

comment:2 by Kyle, 13 years ago

--enable-shared was not used, this is the command line used to configure:

../source/ffmpeg-git/configure --enable-gpl --enable-version3 --enable-runtime-cpudetect --cross-prefix=i686-w64-mingw32- --target-os=mingw32 --arch=x86 --disable-debug

I'm not sure if it's directly related to dxva2api.h, DXVA2_Fixed32OpaqueAlpha can be found inside.

Header attached.

comment:3 by Carl Eugen Hoyos, 13 years ago

Afaict, the functions (that currently only use forceinline) defined in dxva2api.h all have to be defined "static" (as it is done in many internal FFmpeg headers, for example libavformat/network.h).

Could you report this to the w64 mingw-runtime developers?
(Or am I missing something?)

An alternative would be be to try

#undef __forceinline
#define __forceinline static av_always_inline

before including the header.

comment:4 by Kyle, 13 years ago

I contacted mingw-w64, they say a fix is on the way.

I'll report back once I have a successful build and this bug can be resolved.

comment:5 by Kyle, 13 years ago

This bug has been resolved.

comment:6 by Carl Eugen Hoyos, 13 years ago

Resolution: invalid
Status: openclosed
Note: See TracTickets for help on using tickets.