I'm trying to compile some old code of OpenCV that I found here.
However, the code seems quite old. I was able to compile it by adding the new headers
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace cv;
to the files global.h
and IntImage.h
, with addition of
#include <opencv/cv.h>
to the IntImage.h
.
Note that I don't want to port all the code to OpenCV 2.4.9 right now, but rather to make it work. Thus, once that compile I still obtain the error:
UIUCscene.o: In function
IntImage<double>::Load(std::string const&)': UIUCscene.cpp:(.text._ZN8IntImageIdE4LoadERKSs[_ZN8IntImageIdE4LoadERKSs]+0x20): undefined reference to
cvLoadImage' UIUCscene.cpp:(.text._ZN8IntImageIdE4LoadERKSs[_ZN8IntImageIdE4LoadERKSs]+0x53): undefined reference tocvCreateImage' UIUCscene.cpp:(.text._ZN8IntImageIdE4LoadERKSs[_ZN8IntImageIdE4LoadERKSs]+0x6b): undefined reference to
cvCvtColor' UIUCscene.cpp:(.text._ZN8IntImageIdE4LoadERKSs[_ZN8IntImageIdE4LoadERKSs]+0x78): undefined reference tocvReleaseImage' UIUCscene.cpp:(.text._ZN8IntImageIdE4LoadERKSs[_ZN8IntImageIdE4LoadERKSs]+0x73c): undefined reference to
cvReleaseImage' collect2: error: ld returned 1 exit status make: * [place] Error 1
It seems to me that the problem is linking. However, I'm not sure where the problem is. In the Makefile
the flags are set using pkg-config --cflags opencv
, and the same for retrieving the libraries.
What am I missing? Any help or pointers are appreciated.