-1

I was trying to install opencv with devc++ on my windows system. I installed opencv and then added a new compiler in devc++.

I added the following command in calling the new compiler section

-L"C:\OpenCV\lib" -lcxcore210 -lcv210 -lcvaux210 -lhighgui210 -lml210

I added the follwing command for linker command line

-lcxcore210 -lcv210 -lcvaux210 -lhighgui210 -lml210

I added the corresponding opencv binaries,libraries and includes too and added opencv/bin to environment variables.

However when i try to run follwing opencv code,

#include <iostream>
#include <conio.h>

using namespace std;
#include "cv.h"
#include "highgui.h"
using namespace cv;

int main()
{
   cv::Mat img;

    getch();

}

It gives the following error.

[Linker error] C:\Users\user\AppData\Local\Temp\ccGQvgqG.o:filename.cpp:(.text$_ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x3f): undefined reference to `cv::fastFree(void*)'

too honest for this site
  • 12,050
  • 4
  • 30
  • 52
Harjatin
  • 1,313
  • 1
  • 12
  • 22
  • 1
    OpenCV 2.1.0 in 2016? Is this for real? Anyway, did you compile OpenCV with your compiler or are you trying to use prebuilt OpenCV libraries? Also, is this C or C++? – Berriel May 27 '16 at 02:05
  • I am trying to use the prebuilt library. This is Opencv 2.10 as i could not make the 3.0 work. It gave the same issues. http://anikettatipamula.blogspot.com/2012/02/setting-up-opencv-on-dev-c.html This link was using 2.10 version so i though that would be a good start. – Harjatin May 27 '16 at 02:45

1 Answers1

0

Please, do not use OpenCV 2.1.0.

Use OpenCV 2.4.13 or 3+.

As you can read in the documentation:

Prebuilt libraries [...] only works if you are coding with the latest Microsoft Visual Studio IDE.

If you want to use other compiler than Visual C++, you must build OpenCV libraries yourself. A good start is this tutorial. Take care, because they are "long-obsolete and contain inaccurate information".

Berriel
  • 12,659
  • 4
  • 43
  • 67