Linux-Mint

ld 找不到 -lQt5Multimedia

  • September 1, 2014

我正在嘗試為 Linux 建構BBQScreen。在製作過程中,我收到以下錯誤:

g++ -m64 -o Linux/BBQScreenClient2 debug/main.o debug/mainwindow.o debug/screenform.o debug/QStreamDecoder.o debug/stdafx.o debug/ShrinkableQLabel.o debug/qrc_mainwindow.o debug/moc_screenform.o debug/moc_mainwindow.o debug/moc_QStreamDecoder.o debug/moc_ShrinkableQLabel.o   -L/usr/X11R6/lib64 -L/usr/local/lib -lavutil -lavcodec -lavformat -lswscale -lswresample -lz -lQt5OpenGL -L/usr/lib/x86_64-linux-gnu -lQt5Multimedia -lQt5Widgets -lQt5Network -lQt5Gui -lQt5Core -lGL -lpthread 

/usr/bin/ld: cannot find -lQt5Multimedia
collect2: error: ld returned 1 exit status
make: *** [Linux/BBQScreenClient2] Error 1

但是,Qt5Multimedia已安裝:

$ sudo apt-get install libqt5multimedia5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libqt5multimedia5 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

知道為什麼會這樣嗎?

編輯:我也qtmultimedia5-dev安裝了。

你應該這樣做:

一開始發現dpkg -L libqt5multimedia5

我在/usr/lib/i386-linux-gnu/Then找到的庫

添加-L /usr/lib/i386-linux-gnu/到您的 Makefile。

然後你應該添加 -IYOURINCLUDEDIR到 Makefile

我的更新:

這樣做:

root@debian:/home/mohsen# pkg-config --libs --cflags Qt5Multimedia
-I/usr/include/i386-linux-gnu/qt5/QtMultimedia -I/usr/include/i386-linux-gnu/qt5 -I/usr/include/i386-linux-gnu/qt5/QtNetwork -I/usr/include/i386-linux-gnu/qt5 -I/usr/include/i386-linux-gnu/qt5/QtGui -I/usr/include/i386-linux-gnu/qt5 -I/usr/include/i386-linux-gnu/qt5/QtCore -I/usr/include/i386-linux-gnu/qt5 -lQt5Multimedia -lQt5Network -lQt5Gui -lQt5Core 

引用自:https://unix.stackexchange.com/questions/153204