I'm getting an Error in C++ - error: cannot convert ‘cv::Point_<int>’ to ‘cv::Point* {aka cv::Point_<int>*}’ in return

I'm try to run the code below and I'm getting an error. I'm creating an wrapper for an OpenCV function called 'Mat::at' and I'm trying to get it to compile to an '.so' on Ubuntu Trusty using 'G++'. I listed the contents of my '.cpp' file my '.hpp' file my error and my compile command below. I would appreciate any help on returning this C++ OpenCV function as a C pointer. Because that is my goal. Thank you.

Error:

 error: cannot convert ‘cv::Point_<int>’ to ‘cv::Point* 
    {aka cv::Point_<int>*}’ in return
 return self->at<Point>(row, col); 

(I also get the normal "Contol reaches end of non-void function error")

Cpp:

 Point* cv_Mat_at_Point(Mat* self, int row, int col) {
   return self->at<Point>(row, col);
 }

Hpp:

 Point* cv_Mat_at_Point(Mat* self, int row, int col)

Compile Command:

 g++ -Wall -shared -fPIC -o c-binding.so c-binding.cpp

Edit for RedX:

Point* cv_create_Point(int x, int y) {
    return new Point(x, y);
}

Answers


it should be return &self->at<Point>(row, col);

since the function is expecting Point*


Need Your Help

Add alert window before deleting row from DB

php javascript sql ajax

How to add Question alert window (something like "Delete row 2?") before deleting the entry from DB?

plotting negative numbers with flot / jquery

javascript jquery flot

I know Im missing something retarded here... All Im trying to do is graph f(x) = 2500 for a range of x from -75 to 75. This should make a horizontal line. Right now, I think its a misunderstanding ...