【问题标题】:Qt Creator with FFmpeg unresolved external带有 FFmpeg 的 Qt Creator 无法解析外部
【发布时间】:2014-12-09 22:42:00
【问题描述】:

我在 Windows 中使用带有 FFmpeg 的 Qt Creator。 我使用 vs2012 构建了 FFmpeg,并在项目构建环境的 INCLUDE 和 LIB 中指定了路径。 然而,当我尝试执行此代码时遇到了错误:

#include "mainwindow.h"
#include <QApplication>
#include "libavcodec\avcodec.h"
#include "libavformat\avformat.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;
    w.show();

    av_register_all();

    return a.exec();
}

这是错误: LNK2019:函数 _main 中引用的未解析外部符号“void __cdecl av_register_all(void)”(?av_register_all@@YAXXZ)

有人可以帮忙吗?

【问题讨论】:

  • 您确定将您的应用程序与 ffmpeg 相关联吗?是否使用与您的代码相同的选项进行编译?

标签: c++ qt visual-studio-2012 ffmpeg


【解决方案1】:

您正在将 cpp 库链接到 C 库。

extern "C" {
#include "libavcodec\avcodec.h"
#include "libavformat\avformat.h"
}

【讨论】:

  • LNK2019:函数 _main 中引用的未解析的外部符号 _av_register_all
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-02-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-05-29
  • 1970-01-01
  • 2016-06-08
相关资源
最近更新 更多