1

For some quick background, I have OpenCV 2.4.11 on Ubuntu 14.04. I'm having no issues compiling on OSX, so I have ported over to try to make it work on Linux.

I'm getting a DSO missing from command line when trying to compile a very simple OpenCV cpp application - as below:

#define USE_OPENCV
#include <cstring>
#include <cstdlib>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <algorithm>
#include <memory>
#include <utility>

using namespace std;


int main (int argc, char** argv){

    cv::Mat img = cv::imread("/home/roots/Matt/RCME/Data/Data_256/0/000000.jpg");
    cv::imshow("image", img);
    cv::waitKey(0);
    return 0;
}

Here is the Makefile I'm using

CC = g++ -std=c++11

LFLAGS = $(`pkg-config --cflags --libs opencv`)  -L/usr/local/cuda-7.5/lib64 -L $(QTLIB)

INCLUDES = -L $(QTINC)
all: main

main: classify.cpp
    $(CC) -o classify classify.cpp $(LFLAGS) `pkg-config --cflags --libs opencv` `pkg-config --cflags --libs protobuf` $(INCLUDES) -lQtCore -lQtGui

And below is what the terminal spits out when I run make

make
g++ -std=c++11 -o classify classify.cpp   -L/usr/local/cuda-7.5/lib64 -L  `pkg-config --cflags --libs opencv` `pkg-config --cflags --libs protobuf` -L  -lQtCore -lQtGui
/usr/bin/ld: /usr/local/lib/libopencv_highgui.a(window_QT.cpp.o): undefined reference to symbol '_ZN7QObject10childEventEP11QChildEvent'
//usr/lib/x86_64-linux-gnu/libQtCore.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [main] Error 1

Anyone have any suggestions on how to handle this? I'm linking (at least I think I am) to lQtCore and lQtGui, so why is it that I'm still seeing a DSO error?

Chimi
  • 315
  • 2
  • 5
  • 16
  • Did you add that to pro file. Check this thread http://stackoverflow.com/questions/26376587/porting-app-from-qt-4-8-to-qt-5-3-getting-dso-missing-from-command-line – ganeshredcobra Feb 21 '17 at 10:54
  • What's a pro file - project file? Doesn't that only apply when using qmake? Do I have to use qmake? I'm confused, since I haven't had to do this on other machines with installations of OpenCV... first time I'm encountering this. – Chimi Feb 21 '17 at 17:30
  • Possible duplicate of [Strange linking error: DSO missing from command line](https://stackoverflow.com/questions/19901934/strange-linking-error-dso-missing-from-command-line) – perror Jul 18 '17 at 16:42

0 Answers0