I am working on Ubuntu 16.04. I am trying to make
darknet after having successfully installed OpenCV. I have already successfully installed darknet with CUDA support, but I am now trying to empower it with OpenCV, setting OPENCV=1
in its makefile as indicated in the official page ().
This is (an extract) of the output I get from make
:
[...]
/usr/local/lib/libopencv_highgui.so: undefined reference to `QWidget::isFullScreen() const@Qt_5'
/usr/local/lib/libopencv_highgui.so: undefined reference to `QWidget::hasHeightForWidth() const@Qt_5'
/usr/local/lib/libopencv_highgui.so: undefined reference to `QPen::QPen(QBrush const&, double, Qt::PenStyle, Qt::PenCapStyle, Qt::PenJoinStyle)@Qt_5'
/usr/local/lib/libopencv_highgui.so: undefined reference to `QStatusBar::showMessage(QString const&, int)@Qt_5'
[...]
I get a similar outcome if I try to build some test projects to verify the correct functioning of OpenCV. So I believe the problem lies in some linkage around OpenCV.
It seems make
does not see Qt libraries in its path. I tried to fix this problem by adding the library folder of Qt5 to both PATH and LD_LIBRARY_PATH, as suggested by this answer, adding the following lines to my .profile
file:
export LD_LIBRARY_PATH=/usr/include/x86_64-linux-gnu/qt5:$LD_LIBRARY_PATH
export PATH=/usr/include/x86_64-linux-gnu/qt5:$PATH
then running source .profile
and making sure the content was successfully updated with echo PATH
and echo LD_LIBRARY_PATH
. The outcome was the same.
Is it possible that the folder I added to the path was incorrect? What else could be the cause of this problem?
The issue had to do with the installation of OpenCV. I pulled the latest version of opencv
and opencv-contrib
and rebuilt them from scratch, following the installation instructions in detail. After that, I could successfully make
darknet.