cannot convert from 'overloaded-function'
Hey; I'm setting up a wrapper for a library that uses some weird
datatypes (IMO):
The ADT (In mupdf::Data):
struct fz_colorspace_s
{
int refs;
char name[16];
int n;
void (*convpixmap)(fz_colorspace *ss, fz_pixmap *sp, fz_colorspace
*ds, fz_pixmap *dp);
void (*convcolor)(fz_colorspace *ss, float *sv, fz_colorspace
*ds, float *dv);
void (*toxyz)(fz_colorspace *, float *src, float *xyz);
void (*fromxyz)(fz_colorspace *, float *xyz, float *dst);
void (*drop)(fz_colorspace *);
};
Int mupdf::Functions:
[DllImport("fitzlib.dll")]
static void pdf_convcolor(Data::fz_colorspace *ss, float *sv,
Data::fz_colorspace *ds, float *dv);
[DllImport("fitzlib.dll")]
static void pdf_convpixmap(Data::fz_colorspace *ss, Data::fz_pixmap
*sp, Data::fz_colorspace *ds, Data::fz_pixmap *dp);
[DllImport("fitzlib.dll")]
static void xyztorgb(Data::fz_colorspace *fzcs, float *xyz, float
*rgb);
[DllImport("fitzlib.dll")]
static void rgbtoxyz(Data::fz_colorspace *fzcs, float *rgb, float
*xyz);
The declaration (In main()):
mupdf::Functions muf;
mupdf::Data::fz_colorspace pdf_devicergb = { -1, "DeviceRGB", 3,
muf.pdf_convpixmap, muf.pdf_convcolor, muf.rgbtoxyz,
muf.xyztorgb, nil };
The pdf_devicergb declaration is throwing fits:
..\sandbox2.cpp(38) : error C2440: 'initializing' : cannot convert from
'overloaded-function' to 'void (__cdecl *)(mupdf::Data::fz_colorspace
*,mupdf::Data::fz_pixmap *,mupdf::Data::fz_colorspace
*,mupdf::Data::fz_pixmap *)'
None of the functions with this name in scope match the target
type
..\sandbox2.cpp(38) : error C2440: 'initializing' : cannot convert from
'overloaded-function' to 'void (__cdecl *)(mupdf::Data::fz_colorspace
*,float *,mupdf::Data::fz_colorspace *,float *)'
None of the functions with this name in scope match the target
type
..\sandbox2.cpp(38) : error C2440: 'initializing' : cannot convert from
'overloaded-function' to 'void (__cdecl *)(mupdf::Data::fz_colorspace
*,float *,float *)'
None of the functions with this name in scope match the target
type
..\sandbox2.cpp(38) : error C2440: 'initializing' : cannot convert from
'overloaded-function' to 'void (__cdecl *)(mupdf::Data::fz_colorspace
*,float *,float *)'
None of the functions with this name in scope match the target
type
..\sandbox2.cpp(38) : error C2440: 'initializing' : cannot convert from
'void *' to 'void (__cdecl *)(mupdf::Data::fz_colorspace *)'
Conversion from 'void*' to pointer to non-'void' requires an
explicit cast
Any help?
SigmaX