正如標題所說,我一直在試圖讓ffmpeg/libav庫在MSVC++ 2010中工作。 但是,我在編譯調試時仍在運行以下錯誤模式。在Visual Studio中使用ffmpeg靜態庫explode C++ 2010項目
代碼:
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 main(int argc, char* argv[])
{
av_register_all();
return 0;
}
控制檯:
1>------ Build started: Project: ffmpeg, Configuration: Debug Win32 ------
1>ffmpeg.obj : error LNK2019: unresolved external symbol _av_register_all referenced in function _main
1>C:\Users\okki\documents\visual studio 2010\Projects\ffmpeg\Debug\ffmpeg.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
我用zeranoe's最新版本的git-56ba331(2013年5月14日)。
我曾嘗試以下解決這個問題:
- 配置項目來尋找x64和x86庫兩者。
- 將'shared'包中的DLL添加到兩個庫文件夾中。
- 將庫目錄添加到鏈接器選項和VC++目錄。
我一直堅持這一段時間,任何建議都可以提供幫助。 如果需要額外的信息,我會很樂意提供。
的可能的複製[什麼是未定義參考/解析的外部符號錯誤,我該如何解決? ](http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-doi-i-fix) – Niall