首页 文章

如何在cygwin环境中使用mingw-w64工具链编译ffmpeg

提问于
浏览
1

我想在cygwin环境中使用mingw-w64编译器编译ffmpeg项目 . 我采取了以下步骤:

  • 使用setup-x86_64.exe安装了cygwin和mingw-w64软件包,并从https://git.ffmpeg.org/ffmpeg.git git克隆了ffmpeg项目 .

  • 进入ffmpeg文件夹,执行以下命令 .

./configure --host-os = x86_64-w64-mingw32 --enable-shared --disable-static

使

我发现make命令没有从mingw-w64调用编译器,而是从cygwin调用编译器,我已经尝试了命令“make CC = x86_64-w64-mingw32-gcc”,但它失败了一些关于丢失的错误头文件如下:

fatal error: sys/ioctl.h: No such file or directory

我认为已经安装了这些头文件 . 哪个命令是正确的?直接调用命令make或带CC选项的命令?我想用mingw-w64编译来编译ffmpeg,我怎样才能实现我的目标?

1 回答

  • 0

    使用apt-cyg

    # apt-cyg packageof ioctl.h
    cygwin-devel: usr/include/sys/ioctl.h
    
    mingw64-x86_64-headers: usr/x86_64-w64-mingw32/sys-root/mingw/include/ddk/usbstorioctl.h
    mingw64-x86_64-headers: usr/x86_64-w64-mingw32/sys-root/mingw/include/devioctl.h
    mingw64-x86_64-headers: usr/x86_64-w64-mingw32/sys-root/mingw/include/usbioctl.h
    mingw64-x86_64-headers: usr/x86_64-w64-mingw32/sys-root/mingw/include/winioctl.h
    
    w32api-headers: usr/include/w32api/ddk/usbstorioctl.h
    w32api-headers: usr/include/w32api/devioctl.h
    w32api-headers: usr/include/w32api/usbioctl.h
    w32api-headers: usr/include/w32api/winioctl.h
    

    因此该文件属于 cygwin-devel 包 . 使用 apt-cyg install cygwin-devel 安装 .

相关问题