【发布时间】:2017-09-25 00:07:44
【问题描述】:
我正在尝试构建以下代码。但它给出的错误是“错误 LNK1120: 5 unresolved externals”。我在 Visual Studio 2013 中使用 C++。正确包含库。 avformat_open_input 方法出现错误。我在我的代码中使用 ffmpeg 中的复用。请帮忙。
const char *url = "H:/Sanduni_projects/ad_2.mp4";
AVFormatContext *s = NULL;
int ret = avformat_open_input(&s, url, NULL, NULL);
if (ret < 0)
abort();
AVDictionary *options = NULL;
av_dict_set(&options, "video_size", "640x480", 0);
av_dict_set(&options, "pixel_format", "rgb24", 0);
if (avformat_open_input(&s, url, NULL, &options) < 0){
abort();
}
av_dict_free(&options);
AVDictionaryEntry *e;
if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
abort();
}
avformat_close_input(&s);
【问题讨论】:
-
您应该在项目属性 -> 链接器 -> 输入处将库添加到您的项目中。
-
已正确添加库
标签: c++ visual-studio ffmpeg