【问题标题】:Linker error using FFMPEG with Visual Studio 2013 Express将 FFMPEG 与 Visual Studio 2013 Express 一起使用的链接器错误
【发布时间】:2013-12-19 17:24:25
【问题描述】:

我正在尝试使用 FFMPEG 库编写程序。我在this 链接中读到。我从 http://ffmpeg.zeranoe.com/builds/ 下载了 Shared 和 Devs 文件。

我创建了一个控制台项目,这是配置:

其他库目录

其他包含目录

这是我的代码:

#include "stdafx.h"
#pragma comment (lib, "avformat.lib")
#pragma comment (lib, "avcodec.lib")
#pragma comment (lib, "avutil.lib")

extern "C"
{
    #ifndef __STDC_CONSTANT_MACROS
    #define __STDC_CONSTANT_MACROS
    #endif
    #include <libavcodec\avcodec.h>
    #include <libavformat\avformat.h>
    #include <libswscale\swscale.h>
    #include <libavutil\avutil.h>
}
int _tmain(int argc, _TCHAR* argv[])
{
    av_register_all();
    return 0;
}

我得到的错误是:

错误 1 ​​错误 LNK2019:未解析的外部符号 _av_register_all 在函数 _wmain C:\Users\Andres\Documents\Visual Studio 中引用 2013\Projects\PruebaFFMPEG\PruebaFFMPEG\PruebaFFMPEG.obj PruebaFFMPEG

错误 2 错误 LNK1120: 1 未解决 外部 C:\Users\Andres\Documents\Visual Studio 2013\Projects\PruebaFFMPEG\Debug\PruebaFFMPEG.exe PruebaFFMPEG

我错过了什么?

【问题讨论】:

    标签: visual-c++ linker ffmpeg visual-studio-2013


    【解决方案1】:

    您似乎正在尝试将 32 位应用程序与 64 位库链接。从http://ffmpeg.zeranoe.com/builds/ 下载 32 位库或为您的解决方案创建 x64 配置。

    【讨论】:

    • 我下载的是 64 位版本,因为我有 64 位 Windows,32 位可以吗? x64 配置如何?
    • 打开项目属性->点击配置管理器...->活动解决方案平台->新建..->选择x64(见截图goo.gl/54ND5t
    猜你喜欢
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-20
    相关资源
    最近更新 更多