目錄
1. 添加包含目錄
2. 添加庫目錄
3. 添加依賴項
4. 添加動態庫目錄
5. 測試
? ? ? ? 在解決方案中右擊項目名稱,彈出的窗口中選擇 "屬性"。
1. 添加包含目錄
? ? ? ? "C/C++" -> "常規" -> ?"附加包含目錄"中添加 ffmpeg中的include目錄。
2. 添加庫目錄
? ? ? ? "鏈接器" -> "常規" -> "附加庫目錄"中添加 ffmpeg中lib目錄。
3. 添加依賴項
? ? ? ? "鏈接器" -> "輸入" -> "附加依賴項"中添加 一下庫名稱:
avcodec.lib
avdevice.lib
avfilter.lib
avformat.lib
avutil.lib
postproc.lib
swresample.lib
swscale.lib
4. 添加動態庫目錄
? ? ? ? "調試" -> "環境" 中添加動態庫所在目錄即可:
例如:PATH=D:\ffmpeg-7.1.1-full_build-shared\bin;%PATH%
5. 測試
#include <iostream>extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
}int main()
{printf("%s\n", avcodec_configuration());return 0;
}