Windows下使用MinGW+msys编译FFmpeg错误

In file included from libavformat/hlsenc.c:26:0:
c:mingwincludeunistd.h:79:1: error: expected ',' or ';' before 'int'
 int __mingw_sleep( unsigned long, unsigned long );
 ^
In file included from libavformat/hlsenc.c:26:0:
c:mingwincludeunistd.h:105:1: error: expected ',' or ';' before 'int'
 int nanosleep( const struct timespec *, struct timespec * );
 ^
c:mingwincludeunistd.h:125:28: error: expected ',' or ';' before 'usleep'
 int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
                            ^
c:mingwincludeunistd.h:138:10: error: conflicting types for '_cdecl'
 unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
          ^
c:mingwincludeunistd.h:125:5: note: previous declaration of '_cdecl' was here


 int _cdecl __MINGW_NOTHROW usleep( useconds_t )__MINGW_ATTRIB_DEPRECATED;
     ^
c:mingwincludeunistd.h:138:33: error: expected ',' or ';' before 'sleep'
 unsigned _cdecl __MINGW_NOTHROW sleep( unsigned );
                                 ^
c:mingwincludeunistd.h:153:12: error: expected '=', ',', ';', 'asm' or '__att
ribute__' before 'ftruncate'
 int _cdecl ftruncate( int, off_t );
            ^
libavformat/hlsenc.c: In function 'hls_window':
libavformat/hlsenc.c:271:5: warning: format '%d' expects argument of type 'int',
 but argument 3 has type 'int64_t' [-Wformat=]
     avio_printf(out, "#EXT-X-MEDIA-SEQUENCE:%"PRId64"n", sequence);
     ^
libavformat/hlsenc.c:274:12: warning: format '%d' expects argument of type 'int'
, but argument 4 has type 'int64_t' [-Wformat=]
            sequence);
            ^
libavformat/hlsenc.c:280:26: warning: format '%i' expects argument of type 'int'
, but argument 3 has type 'int64_t' [-Wformat=]
                          en->size, en->pos);
                          ^
libavformat/hlsenc.c:280:26: warning: format '%i' expects argument of type 'int'
, but argument 4 has type 'int64_t' [-Wformat=]

make: *** [libavformat/hlsenc.o] Error 1


编译以下文件:

libavutilfile.c
libavutilfile_open.c
libavutillog.c
libavutilrandom_seed.c
libavutiltime.c
libavformatcache.c
libavformatdashenc.c
libavformatfile.c
libavformathdsenc.c
libavformatsmoothstreamingenc.c
libavformathlsenc.c
libavcodeclibxvid.c
libavcodeclibxvid_rc.c
ffmpeg.c

都有这个错误。其实是没有找到 _EXTERN_C _cdecl __MINGW_NOTHROW ,其在 window.h 中。


解决办法:在以上文件中, #include <unistd.h> 之前加上 #include <windows.h>


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值