1
我正在製作一個C++程序,我想使用FFmpeg預先爲x64編譯,這是一個C編譯庫。 我使用這個代碼,以包含它的頭:Visual C++鏈接器無法解析FFmpeg的外部符號
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#pragma comment (lib,"G:/Documents/ffmpeg/lib/avcodec.lib")
#pragma comment (lib,"G:/Documents/ffmpeg/lib/avformat.lib")
}
然後我打電話的符號一樣,我會爲一個正常的功能做的,例如與av_interleaved_write_frame(out->formatContext, &packet);
然而,當我嘗試要與Visual Studio 2015年的內置C++編譯器編譯它,我得到了很多錯誤,像
Error LNK2019 unresolved external symbol _av_write_trailer referenced in function "void __cdecl closeArenaVideo(struct VideoOutput *)" ([email protected]@[email protected]@@Z) Sparta2 c:\Users\Théo\documents\visual studio 2015\Projects\Sparta2\Sparta2\video.obj
的基本上任何我指的符號。
我試圖在Visual Studio中導入一切,用命令行編譯,手動將FFmpeg的庫放到默認庫路徑中,但沒有成功。
預先感謝您!
檢查[這個答案](http://stackoverflow.com/a/11701737/868014)和它的底部更新有關32/64 lib混淆,它可能也是你的情況。 –
非常感謝,確實是這個問題!如果你願意,你可以做出正確的答案,我會將其標記爲已接受。 – JustPingo