gpt4 book ai didi

c - 使用 cabal 安装 ffmpeg-light

转载 作者:行者123 更新时间:2023-11-30 16:57:18 24 4
gpt4 key购买 nike

我想在 Windows 10(64 位)上通过 cabal 从 hackage 安装 ffmpeg-light 库。所以我下载了ffmpeg并将其解压到C:\FFmpeg。

起初 pkg-config 提示它找不到各种软件包。我用 .pc 文件解决了这个问题。

当我尝试使用命令:cabal install ffmpeg-light cabal 提示缺少 C 库,而这正是我为其创建 .pc 文件的库。

然后我尝试了命令:cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib。现在我有一条不同的错误消息,其中显示:

Enums.hsc:7:32: fatal error: libavcodec/avcodec.h: No such file or directory

编辑:
然后我尝试了以下命令:

cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib \
--extra-include-dirs=C:\FFmpeg\include

现在,编译器首先给出一些有关 ffmpeg 中已弃用函数和 ffmpeg-light 中冗余导入的警告,但编译了 11 个中的 11 个。但构建仍然不成功。

In-place registering ffmpeg-light-0.11.1...
setup-Simple-Cabal-1.22.5.0-x86_64-windows-ghc-7.10.3.exe:
'C:\Haskell\bin\ghc-pkg.exe' exited with an error:
ffmpeg-light-0.11.1: Warning: haddock-interfaces:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light\ffmpeg-light.haddock
doesn't exist or isn't a file
ffmpeg-light-0.11.1: Warning: haddock-html:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light
doesn't exist or isn't a directory
ffmpeg-light-0.11.1: library-dirs: C:FFmpeglib is a relative path which makes
no sense (as there is nothing for it to be relative to). You can make paths
relative to the package database itself by using ${pkgroot}. (use --force to
override)
ffmpeg-light-0.11.1: include-dirs: C:FFmpeginclude is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cabal: Error: some packages failed to install:
ffmpeg-light-0.11.1 failed during the building phase. The exception was:
ExitFailure 1

一些附加信息:

cabal version: cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
gcc version of my installed Haskell platform: 5.2.0

我用于 pkg-config 的示例 .pc 文件:

Name: libavcodec
Description: Library for ffmpeg
Version: 57
Cflags: -IC:\FFmpeg\include
Libs: -LC:\FFmpeg\lib -llibavcodec

最佳答案

好的。我想到了。需要 --ghc-pkg-options="--force"选项。

cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib --extra-include-dirs=C:\FFmpeg\include --ghc-pkg-options="--force"

关于c - 使用 cabal 安装 ffmpeg-light,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39591891/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com