Я пытаюсь импортировать VLC в Qt. Ошибки, с которыми я сталкиваюсь при запуске программы:
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl VlcMediaPlayer::VlcMediaPlayer(class VlcInstance *)" (__imp_??0VlcMediaPlayer@@QEAA@PEAVVlcInstance@@@Z) referenced in function main
main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl VlcMediaPlayer::~VlcMediaPlayer(void)" (__imp_??1VlcMediaPlayer@@UEAA@XZ) referenced in function "public: virtual void * __cdecl VlcMediaPlayer::`scalar deleting destructor'(unsigned int)" (??_GVlcMediaPlayer@@UEAAPEAXI@Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl VlcMediaPlayer::metaObject(void)const " (?metaObject@VlcMediaPlayer@@UEBAPEBUQMetaObject@@XZ)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual int __cdecl VlcMediaPlayer::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@VlcMediaPlayer@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)
main.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void * __cdecl VlcMediaPlayer::qt_metacast(char const *)" (?qt_metacast@VlcMediaPlayer@@UEAAPEAXPEBD@Z)
Код (main.cpp) приведен ниже:
#include "mainwindow.h"#include <QApplication>
#include "vlc.h"#include "libvlc.h"#include "MediaPlayer.h"#include "Video.h"#include "Common.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// MainWindow w;
// w.show();
VlcInstance *instance;
VlcMediaPlayer *player=new VlcMediaPlayer(instance);return a.exec();
}
.профессионал файл приведен ниже:
#-------------------------------------------------
#
# Project created by QtCreator 2014-01-31T15:09:35
#
#-------------------------------------------------
QT += core gui multimedia
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Wontwork
TEMPLATE = app
CONFIG += debug_and_release
CONFIG += build_all
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h\
libvlc.h \
vlc.hFORMS += mainwindow.ui
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../Qt/libvlc/release/ -lvlc-qt
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../Qt/libvlc/debug/ -lvlc-qt
else:unix: LIBS += -L$$PWD/../../../../Qt/libvlc/ -lvlc-qt
INCLUDEPATH += $$PWD/../../../../Qt/libvlc/debug
DEPENDPATH += $$PWD/../../../../Qt/libvlc/debug
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../../../Qt/libvlc/release/ -lvlc-qt-widgets
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../../../Qt/libvlc/debug/ -lvlc-qt-widgets
else:unix: LIBS += -L$$PWD/../../../../Qt/libvlc/ -lvlc-qt-widgets
INCLUDEPATH += $$PWD/../../../../Qt/libvlc/debug
DEPENDPATH += $$PWD/../../../../Qt/libvlc/debug
Что я должен сделать, чтобы заставить это работать должным образом?
Задача ещё не решена.
Других решений пока нет …