ios Objective C++: No matching function for call to CVPixelBufferGetBaseAddress

The below code generates the error "No matching function for call to CVPixelBufferGetBaseAddress":

(void) GetImage: (CMSampleBufferRef) buffer { void *address = CVPixelBufferGetBaseAddress(buffer); ... }

I had included CoreVideo and AVFoundation frameworks. It doesn't help. Interesting is that if I add the code in an m-file I get no error. Adding this code to an mm-file in the same project creates the error. Any idea how to fix? Thanks

Replies

That method takes a CVPixelBufferRef, not a CMSampleBufferRef. C++ is more strict about types than C.