美文网首页C语言C++
用vcpkg install ffmpeg后还是提示无法解析外部

用vcpkg install ffmpeg后还是提示无法解析外部

作者: 毛毛v5 | 来源:发表于2019-04-11 13:47 被阅读0次

vcpkg 很方便了解决了 c++开发时的项目的第三方开源代码依赖问题。方便的很,vcpkg install ffmpeg后,啥都不用直接#include ffmpeg的头文件就可以使用ffmpeg了。再也不用自己哼哧哼哧的下载编译,还要配置工程,添加库依赖了。但是#include的时候要注意这样:


#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"包住的话,照样提示无法解析外部符号。还得我以为vcpkg不好用呢。。。

相关文章

网友评论

    本文标题:用vcpkg install ffmpeg后还是提示无法解析外部

    本文链接:https://www.haomeiwen.com/subject/qpjtwqtx.html