Ask Your Question
0

'=' : cannot convert from 'void *' to 'CvPoint *' 1> Conversion from 'void*' to pointer to non-'void' requires an explicit cast

asked 2013-03-15 03:57:05 -0600

roomini gravatar image

updated 2013-03-15 06:35:17 -0600

m trying to execute the code which is in https://github.com/bengal/opencv-hand-detection but getting the error above.. m new to this.. please help me out..

line:87, error:'=' : cannot convert from 'void ' to 'CvPoint *' Conversion from 'void' to pointer to non-'void' requires an explicit cast

line:88, error:'=' : cannot convert from 'void ' to 'CvPoint *' Conversion from 'void' to pointer to non-'void' requires an explicit cast

line:167, error:'=' : cannot convert from 'void ' to 'CvConvexityDefect *' Conversion from 'void' to pointer to non-'void' requires an explicit cast

line:194, error:'sqrt' : ambiguous call to overloaded function c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(589): could be 'long double sqrt(long double)' c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(541): or 'float sqrt(float)' c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h(127): or 'double sqrt(double)' while trying to match the argument list '(int)'

line:218, error:'=' : cannot convert from 'void ' to 'CvPoint *' Conversion from 'void' to pointer to non-'void' requires an explicit cast

Any help would be greatly appreciated. Thanks in advance

edit retag flag offensive close merge delete

Comments

312 lines of code, please specify, where it happens ;(

berak gravatar imageberak ( 2013-03-15 04:01:43 -0600 )edit
1

did you actually tried the suggested approach below? Because the explicit conversion will actually fix the problem ...

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-15 06:48:21 -0600 )edit

m new to this language m nt getting wats all this explicit conversion :'(

roomini gravatar imageroomini ( 2013-03-16 00:28:42 -0600 )edit
1

just place for each malloc in your code, the explicit rule that vladislav explained. It will solve the problem :) Not that hard right?

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-16 02:30:02 -0600 )edit

Yep i got it ;) but i have an exception too :( can u please try to solve this?? help me out na....

Unhandled exception at 0x754fc41f in meghana.exe: Microsoft C++ exception: cv::Exception at memory location 0x0033f288.. i dnt kno y m getting this

roomini gravatar imageroomini ( 2013-03-18 01:06:25 -0600 )edit

this is actually telling you are trying to reach for a location in memory that does not exist or that is locked for editing. If you use the C-like API, you need to pay large attention in using pointers and such!

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-18 08:12:20 -0600 )edit

so wat should i do now?

roomini gravatar imageroomini ( 2013-03-19 01:05:58 -0600 )edit

Examing the path of your pointers. Make a sketch of how your data is handled, and it will be clear where it goes wrong. Or switch towards C++ style API if you do not want to take care of this manually.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-03-19 02:56:03 -0600 )edit

@roomini, if u solved the problem, can you help me out what you did?

jj gravatar imagejj ( 2014-02-11 11:39:04 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-03-15 04:26:54 -0600

Vladislav Vinogradov gravatar image

Just add explicit conversion to CvPoint* type:

CvPoint* ptr = (CvPoint*) malloc(...)
edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-03-15 03:57:05 -0600

Seen: 1,261 times

Last updated: Mar 15 '13