首页 > 解决方案 > VlcQt 中对函数的未定义引用(安装后)

问题描述

我最近为 ubuntu 16.04 安装了 VlcQt 库,但是当我尝试使用它时,我得到的只是undefined reference to 'some_function()'.

目前我正在尝试将视频播放器暴露给 QML。

主文件

#include <QGuiApplication>
#include <VLCQtCore/Common.h>
#include <VLCQtQml/QmlVideoPlayer.h>

#include "Controller.h"

int main(int argc, char *argv[])
{
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QGuiApplication app(argc, argv);

    VlcCommon::setPluginPath(app.applicationDirPath() + "plugins");
    VlcQmlVideoPlayer::registerPlugin();

    Controller controller;
    QQuickWindow *quickWindow = qobject_cast<QQuickWindow *>(controller.view());
    quickWindow->show();

    return app.exec();
}

当我尝试包含库时,Qt intellisense 正在检测该库是否存在。

我究竟做错了什么?

谢谢您的帮助!

//编辑:

我通过他们的存储库安装了它:

add-apt-repository ppa:ntadej/tano 
apt-get install libvlc-qt-core2 libvlc-qt-widgets2 libvlc-qt-dbg libvlc-qt-dev 

//编辑:这就是我在 .pro 文件中添加库的方式,也已经尝试INCLUDEPATH过了

LIBS += -lvlccore -lvlc

标签: c++qtvlc-qt

解决方案


推荐阅读