Getting openCV set up in codeblocks

asked 2013-02-13 22:56:06 -0500

xzerobit gravatar image

updated 2013-02-13 23:02:09 -0500

Hello there,

I'm new here and I've been trying to set up OpenCV on my codeblocks IDE. I'm not sure whats wrong. I'm using windows 7, 64bit system, and codeblocks, I also downloaded the latest OpenCV.

I tried following the manual intsructions here, but that was of no help: http://opencv.willowgarage.com/wiki/CodeBlocks

Even though I'm trying to use codeblocks I also tried:
http://stackoverflow.com/questions/10901905/installing-opencv-2-4-3-in-visual-c-2010-express

I have my path set to:
C:\OpenCV\build\x64\vc11\bin

And for the compiler settings under tab "search directories":
"Compiler" : C:\OpenCV\build\include
"Linker" : C:\OpenCV\build\x64\vc11\lib

And then under the tab "Linker settings" I have all the .lib files from
C:\OpenCV\build\x64\vc11\lib

I tried running this as my test program and it gives me an error readout connecting to operations.hpp header file:

#include "opencv2/highgui/highgui.hpp"
#include "iostream"

using namespace cv;
using namespace std;

int main()
{
Mat im = imread("c:/full/path/to/lena.jpg");
if (im.empty())
{
cout << "Cannot load image!" << endl;
return -1;
}
imshow("Image", im);
waitKey(0);
}

The error says: C:\OpenCV\build\include\opencv2\core\operations.hpp|3915|error: expected primary-expression before '>' token|
C:\OpenCV\build\include\opencv2\core\operations.hpp|3915|error: expected primary-expression before ')' token|
....and a bunch of other stuff, but those are the first 2 errors.

So my 2 fold question is this:
1) Did I set up my IDE correctly?
2) Is there something wrong with the OpenCV code?

And SERIOUSLY, THANK YOU, to anyone who can help me. I'm trying to get this set up for a class I'm taking.

edit retag flag offensive close merge delete