So where is your code and How do you do that?
I would refrain from Long dead IDE like DevCPP and get decent one like C::B or Codelite.
I use CodeLite
Try this example and see if it compiles
//
// Simple retro-style photo effect done by adding noise to
// the luminance channel and reducing intensity of the chroma channels
//
// include standard OpenCV headers, same as before
#include "cv.h"
#include "highgui.h"
// all the new API is put into "cv" namespace. Export its content
using namespace cv;
// enable/disable use of mixed API in the code below.
#define DEMO_MIXED_API_USE 1
int main( int argc, char** argv )
{
const char* imagename = argc > 1 ? argv[1] : "lena.jpg";
#if DEMO_MIXED_API_USE
// Ptr<T> is safe ref-conting pointer class
Ptr<IplImage> iplimg = cvLoadImage(imagename);
// cv::Mat replaces the CvMat and IplImage, but it's easy to convert
// between the old and the new data structures
// (by default, only the header is converted and the data is shared)
Mat img(iplimg);
#else
// the newer cvLoadImage alternative with MATLAB-style name
Mat img = imread(imagename);
#endif
if( !img.data ) // check if the image has been loaded properly
return -1;
Mat img_yuv;
// convert image to YUV color space.
// The output image will be allocated automatically
cvtColor(img, img_yuv, CV_BGR2YCrCb);
// split the image into separate color planes
vector<Mat> planes;
split(img_yuv, planes);
// another Mat constructor; allocates a matrix of the specified
// size and …