![ld找不到-lQt5多媒体](https://linux22.com/image/55046/ld%E6%89%BE%E4%B8%8D%E5%88%B0-lQt5%E5%A4%9A%E5%AA%92%E4%BD%93.png)
我正在尝试建立烧烤屏对于Linux。在make过程中,我收到以下错误:
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
安装了。
答案1
你应该这样做:
一开始发现dpkg -L libqt5multimedia5
/usr/lib/i386-linux-gnu/
我的库在那时找到
添加-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