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?