gpt4 book ai didi

c++ - Visual Studio 2017 C++ 项目中的 Libavcodec "the procedure entry point for av_frame_alloc could not be located"错误

转载 作者:行者123 更新时间:2023-12-01 14:29:54 25 4
gpt4 key购买 nike

我正在尝试将 C++ 中的 ffmpeg 库中的 libavcodec 与 Visual Studio 2017 社区一起使用。我从 zeranoe(版本 20171217)下载了最新的 x64 开发和共享构建,在 Visual Studio 中为 x64 build设置包含目录和附加库,将共享包中的 DLL 文件添加到我的路径中。

这是我的示例测试代码:

extern "C" {
#include <libavcodec\avcodec.h>
}
int main() {
avcodec_register_all();
AVFrame *pAvFrame = av_frame_alloc();
av_frame_free(&pAvFrame);
return 0;
}

代码编译没有问题,但是当我运行应用程序时,我看到一个对话窗口,其中包含错误消息“无法在 DLL 中找到 av_frame_alloc 的过程入口点”(实际消息不是英文,这是翻译版本) .

我尝试将 Linker->Optimization->References 设置为/OPT:NOREF,因为它在类似问题中被建议但没有帮助。

Dependency walker 显示 av_frame_alloc 已导出,“入口点”未绑定(bind)。有点奇怪的是 av_frame_alloc 显示在 avcodec-58.dll(红色)和 avutil-56.dll(绿色)中。也许是因为应用程序试图从 avcodec 而不是 avutil 获取此功能,但我不确定,因为我没有检查这些库的源代码。

所以问题是如何在 VS2017 中建立这样一个基于 FFMPEG 的简单 C++ 项目,我哪里错了?

更新。 1.

链接器标志:/OUT:"C:\work\code\TestFfmpeg\x64\Release\TestFfmpeg.exe"/MANIFEST/NXCOMPAT/PDB:"C:\work\code\TestFfmpeg\x64\Release\TestFfmpeg. pdb"/DYNAMICBASE "c:\work\dev\ffmpeg-20171217-387ee1d-win64-dev\lib*.lib""kernel32.lib""user32.lib""gdi32.lib""winspool.lib""comdlg32. lib” “advapi32.lib” “shell32.lib” “ole32.lib” “oleaut32.lib” “uuid.lib” “odbc32.lib” “odbccp32.lib”/DEBUG:FULL/MACHINE:X64/OPT:NOREF/PGD​​:"C:\work\code\TestFfmpeg\x64\Release\TestFfmpeg.pgd"/MANIFESTUAC:"level='asInvoker' uiAccess='false'"/ManifestFile:"x64\Release\TestFfmpeg.exe.intermediate.manifest "/OPT:ICF/ERRORREPORT:PROMPT/NOLOGO/TLBID:1

最佳答案

尝试下载 32 位版本的 .exe 文件(程序)。这为我解决了 Postman.exe 的问题

关于c++ - Visual Studio 2017 C++ 项目中的 Libavcodec "the procedure entry point for av_frame_alloc could not be located"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47858320/

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