2013-12-19 82 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