Opened 2 weeks ago

Last modified 4 days ago

#2350 new defect

(MSYS2, MinGW, GCC) build error: redefinition of 'struct pollfd' etc. in libavformat/3dostr.c

Reported by: LigH Owned by: beastd
Priority: normal Component: build system
Version: HEAD Severity: blocker
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

Summary of the bug: build error: redefinition of 'struct pollfd' and many more in libavformat/3dostr.c

How to reproduce:
Trying to build using media-autobuild_suite

MSYS2, MinGW32 + GCC 7.3.0 or MinGW64 + GCC 8.3.0

CFLAGS: -mthreads -mtune=generic -O2 -pipe
LDFLAGS: -pipe -static-libgcc -static-libstdc++
make install

...
CC	libavfilter/avfilter.o
In file included from libavformat/internal.h:28:0,
                 from libavformat/3dostr.c:23:
libavformat/os_support.h:115:8: error: redefinition of 'struct pollfd'
 struct pollfd {
        ^~~~~~
In file included from libavformat/os_support.h:112:0,
                 from libavformat/internal.h:28,
                 from libavformat/3dostr.c:23:
H:/development/media-autobuild_suite-master/msys64/mingw32/i686-w64-mingw32/include/winsock2.h:1155:16: note: originally defined here
 typedef struct pollfd {
                ^~~~~~
In file included from libavformat/internal.h:28:0,
                 from libavformat/3dostr.c:23:
libavformat/os_support.h:122:0: warning: "POLLIN" redefined
 #define POLLIN     0x0001  /* any readable data available */
 
In file included from libavformat/os_support.h:112:0,
                 from libavformat/internal.h:28,
                 from libavformat/3dostr.c:23:
H:/development/media-autobuild_suite-master/msys64/mingw32/i686-w64-mingw32/include/winsock2.h:1144:0: note: this is the location of the previous definition
 #define POLLIN    (POLLRDNORM | POLLRDBAND)
 
In file included from libavformat/internal.h:28:0,
                 from libavformat/3dostr.c:23:
libavformat/os_support.h:123:0: warning: "POLLOUT" redefined
 #define POLLOUT    0x0002  /* file descriptor is writeable */
 
In file included from libavformat/os_support.h:112:0,
                 from libavformat/internal.h:28,
                 from libavformat/3dostr.c:23:
H:/development/media-autobuild_suite-master/msys64/mingw32/i686-w64-mingw32/include/winsock2.h:1148:0: note: this is the location of the previous definition
 #define POLLOUT   (POLLWRNORM)
...

Attachments (1)

logs.zip (55.6 KB) - added by LigH 2 weeks ago.
log files generated by media-autobuild_suite, MinGW64 compile

Download all attachments as: .zip

Change History (2)

Changed 2 weeks ago by LigH

log files generated by media-autobuild_suite, MinGW64 compile

comment:1 Changed 4 days ago by LigH

I guess a part of the reason may be that config.h contains

#define HAVE_STRUCT_POLLFD 0

but it still includes winsock2.h which makes os_support.h redefine it accidently.

Note: See TracTickets for help on using tickets.