vcpkg 很方便了解決了 c++開發(fā)時(shí)的項(xiàng)目的第三方開源代碼依賴問題。方便的很,vcpkg install ffmpeg后,啥都不用直接#include ffmpeg的頭文件就可以使用ffmpeg了。再也不用自己哼哧哼哧的下載編譯,還要配置工程,添加庫(kù)依賴了。但是#include的時(shí)候要注意這樣:
#ifdef __cplusplus
extern "C" {
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
#include <libavutil/file.h>
#ifdef __cplusplus
}
#endif
如果不用extern "C"包住的話,照樣提示無(wú)法解析外部符號(hào)。還得我以為vcpkg不好用呢。。。