2013-12-19 83 views
0

我正在尝试使用FFMPEG库编写程序。我在this链接阅读。我从http://ffmpeg.zeranoe.com/builds/下载了Shared和Devs文件。使用FFMPEG与Visual Studio 2013 Express的链接器错误

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

附加库目录 enter image description here

附加包含目录 enter image description here

这里是我的代码:

#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Ç引用:\用户\安德烈斯\文档\ Visual Studio的 2013 \项目\ PruebaFFMPEG \ PruebaFFMPEG \ PruebaFFMPEG.obj PruebaFFMPEG

错误2错误LNK1120:1未解析的外部 C:\用户\安德烈\文件\的Visual Studio 2013 \项目\ PruebaFFMPEG \调试\ PruebaFFMPEG.exe PruebaFFMPEG

我错过了什么?

回答

0

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

+0

我下载的64位版本,因为我有一个64位的Windows,将32位工作? x64配置如何? – Andres

+0

打开项目属性 - >点击Configuration Manager ... - > Active Solution Platform - > New .. - >选择x64(见截图http://goo.gl/54ND5t) – pogorskiy

+0

谢谢你解决了这个问题! – Andres