0

I recently installed VlcQt libary for ubuntu 16.04, but when I try to use it, all i get is undefined reference to 'some_function()'.

Currently I am trying to expose video player to QML.

Main.cpp

#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();
}

When I am trying to include libaries, Qt intellisense is detecting that this libary exists.

What am I doing wrong?

Thank you for your help!

//Edit:

I installed it via their repository:

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

//Edit: This is how I add libs in .pro file, already tried INCLUDEPATH too

LIBS += -lvlccore -lvlc
Brykyz
  • 587
  • 4
  • 30
  • Intellisense detects the API because you included the corresponding header. However this is not an indication that your linker will find that library and link against it. – vahancho Aug 07 '18 at 08:30
  • 1
    Possible duplicate of [What is an undefined reference/unresolved external symbol error and how do I fix it?](https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix) – Alan Birtles Aug 07 '18 at 08:51
  • @vahancho So what am I supposed to do? I included folder that has .so file in it – Brykyz Aug 07 '18 at 08:51
  • [this](https://stackoverflow.com/a/12574400/7699037) should help – Mike van Dyke Aug 07 '18 at 09:29
  • @MikevanDyke unfortunally, i already have this in my .pro file, but somehow, still same problem. Already tried everything in that thread that is linked and still didn't work – Brykyz Aug 07 '18 at 11:16
  • How do you compile and link your code? – Mike van Dyke Aug 07 '18 at 11:32
  • @MikevanDyke I am using Qt creator, so .pro file have `LIBS` and `INCLUDEPATH` keywords – Brykyz Aug 07 '18 at 11:43
  • Have you tried adding the library path to the `LIBS`-flag, i.e. something like `LIBS += -L/path/to/vlccore -L/path/to/vlc -lvlccore -lvlc`. Further information [here](http://doc.qt.io/qt-5/third-party-libraries.html) – Mike van Dyke Aug 07 '18 at 11:50
  • @MikevanDyke Ofcourse, i have already written it in question.. – Brykyz Aug 07 '18 at 12:13
  • But you did not specify the `-L/path/to/library` in the question. `-L` tells the linker where to find the library. – Mike van Dyke Aug 07 '18 at 12:14
  • @MikevanDyke Currently using `LIBS += -L"/usr/local/lib" -lvlccore -lvlc` – Brykyz Aug 07 '18 at 12:16

0 Answers0