I'm trying to build my Qt app using libcamera on Raspberry Pi, but the qt project won't build, instead showing error: DSO missing from command line. I have build libcamera from source (it's a .so lib), and included it in my .pro file:
INCLUDEPATH += $$PWD/../libcamera/include
LIBS += -L$$PWD/../libcamera/build/src/libcamera -lcamera
I also tried this, with the same result:
INCLUDEPATH += /usr/local/include/libcamera
LIBS += -lcamera
And the exact error:
error: /usr/local/lib/aarch64-linux-gnu/libcamera-base.so.0.0.4: error adding symbols: DSO missing from command line
I'm pretty sure I'm including it wrong, but I have no idea how to include it the way for it to finally work. How do I include this correctly?
Edit: LibCamera is installed correctly, as this example from here runs normally. Also other Qt apps run, this one does not.
As for includes - $PWD is actually /home/pi/app and in /home/pi/libcamera I have built libcamera from source.
But /usr/local/include/libcamera does contain header files, and /usr/local/lib/aarch64-linux-gnu does contain libcamera-base.so.
Build command with full output:
g++ -Wl,-rpath,/opt/Qt/6.2.4-armv8/lib -Wl,-rpath-link,/opt/Qt/6.2.4-armv8/lib
-o app LibCamera.o main.o mainwindow.o qrc_resource.o moc_mainwindow.o `pkg-config --cflags --libs opencv4` -lpigpiod_if2
-lrt -ldl -lpython3.9 -lcamera /opt/Qt/6.2.4-armv8/lib/libQt6Charts.so -pthread
/opt/Qt/6.2.4-armv8/lib/libQt6OpenGLWidgets.so /opt/Qt/6.2.4-armv8/lib/libQt6Widgets.so /opt/Qt/6.2.4-armv8/lib/libQt6OpenGL.so
/opt/Qt/6.2.4-armv8/lib/libQt6Gui.so -lEGL /opt/Qt/6.2.4-armv8/lib/libQt6Core.so -lpthread -lGLESv2
/usr/bin/ld: LibCamera.o: undefined reference to symbol '_ZN9libcamera8UniqueFD5resetEi'
/usr/bin/ld: /usr/local/lib/aarch64-linux-gnu/libcamera-base.so.0.0.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:285: app] Error 1
And part of my .pro file (skipping sources, headers and resources):
QT += core gui charts
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++14
QT_CONFIG -= no-pkg-config
INCLUDEPATH += /usr/include/opencv4
LIBS += `pkg-config --cflags --libs opencv4`
LIBS+= -lpigpiod_if2 -lrt -ldl
CONFIG += no_keywords
INCLUDEPATH += /usr/include/python3.9
LIBS += -lpython3.9
INCLUDEPATH += /usr/local/include/libcamera/libcamera
LIBS += -lcamera
pkg-config libcamera --cflags
shows -I/usr/local/include/libcamera
and pkg-config libcamera --libs
shows -L/usr/local/lib/aarch64-linux-gnu -lcamera -lcamera-base