I was trying to compile FLAC v.1.3.2 from source (from xiph's GitHub), under MSYS2 on Windows, using GCC 7.3.0. It was going fine until this part:
In file included from ../../include/share/compat.h:102:0,
from stream_decoder.c:42:
stream_decoder.c: In function ‘get_binary_stdin_’:
stream_decoder.c:1258:10: warning: implicit declaration of function ‘_fileno’; did you mean ‘fileno’? [-Wimplicit-function-declaration]
setmode(_fileno(stdin), _O_BINARY);
^
stream_decoder.c:1258:10: warning: nested extern declaration of ‘_fileno’ [-Wnested-externs]
stream_decoder.c:1258:26: error: ‘_O_BINARY’ undeclared (first use in this function); did you mean ‘O_BINARY’?
setmode(_fileno(stdin), _O_BINARY);
^
stream_decoder.c:1258:26: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:725: stream_decoder.lo] Error 1
make[1]: *** [Makefile:787: all-recursive] Error 1
make: *** [Makefile:429: all-recursive] Error 1
Checking the source for stream_deocder.c, I did see a note regarding the underscore prefix on certain platforms with the O_BINARY flag.
Hi, I also tried building this with the latest version of Cygwin64, (and the necessary packages). This also fails becuase
_O_BINARYisn't defined on modern Cygwin, butO_BINARYis.It's also found in
stream_encoder.c.Last edit: Cinema 2018-12-15