Libavcodec "the procedure entry point for av_frame_alloc could not be located" Visual Studio 2017 C+

Libavcodec "the procedure entry point for av_frame_alloc could not be located" error in Visual Studio 2017 C++ project

本文关键字:be not located Studio 2017 could Visual frame entry procedure the      更新时间:2023-10-16

我正在尝试将ffmpeg库中的libavcodec与Visual Studio 2017社区一起使用。我从Zeranoe(版本20171217)下载了最新的X64 DEV和共享构建,设置了X64构建的Visual Studio中的目录和其他库,在我的路径中添加了DLL文件。

这是我的示例测试代码:

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

毫无问题的代码编译,但是当我运行应用程序时,我会看到带有错误消息的对话窗口" AV_FRAME_ALLOC的过程输入点不能位于DLL中"(实际消息不使用英语,这是翻译版本)。

我尝试将链接器 ->"优化"设置为/opt:opt:noref,如在类似问题中所建议的,但没有帮助。

依赖关系Walker表明AV_FRAME_ALLOC已导出,"入口点"不绑定。有点奇怪的是,av_frame_alloc均在avcodec-58.dll(as Red)和avutil-56.dll(as Green)中显示。也许原因是该应用程序正在尝试从Avcodec而不是Avutil获取此功能,但是我不确定,因为我没有检查这些库的源代码。

因此,问题是如何在VS2017中设置如此简单的基于FFMPEG的C 项目,我错了?

更新。1。

linker flags:/out:"c:沃克 testffmpeg x64 release testffmpeg.exe"/subest/nxcompat/pdb:" c: work work code code testffmpeg x64 x64 x64 x64 warree testffmpeg。pdb"/dynamicbase" c: work dev ffmpeg-20171217-387EEE1D-WIN64-DEV lib*.lib" .lib" kernel32.lib" user32.lib" user32.lib" gdi32.lib" gdi32.lib" gdi32.lib" winspool.lib.lib.lib.lib.lib.lib comdlgg32。lib" advapi32.lib" shell32.lib" ole32.lib" oleaut32.lib" uuid.lib" odbc32.lib" odbccp32.lib"/odbccp32.lib"/decug:full/Machine:full/Machine:x64/opt:x64/opt:noref/noref/noref/noref/opt:noref/opt:noref/optPGD:" C: Work code testffmpeg x64 Release testffmpeg.pgd"/subestuac:" clever ='asinvoker'asinvoker'uiaccess ='false''/manfalsfile:"/opt:ICF/ERRORReport:提示/nologo/tlbid:1

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

的ISSE