unsigned int const does not match const unsigned int

T

Timo Freiberger

Hi everybody,

when I try to compile a program that uses image Magick++ lib, I get the following error:

error: argument of type `unsigned int (Magick::Image::)()
const' does not match `const unsigned int'


here is the code:

// new Image
Image glyph(bitmap.width,bitmap.rows, "K", CharPixel, bitmap.buffer);
// this leads to the error:
unsigned int const c = buchstabe.columns;

My first attempt was to use:

PixelPacket *pixel_cache = glyph.getPixels(0,0,glyph.columns,glyph.rows);

but then I get the error:

error: no matching function for call to `Magick::Image::
getPixels(int, int, <unknown type>, <unknown type>)'
/usr/include/Magick++/Image.h:1134: error: candidates are:
MagickLib::pixelPacket* Magick::Image::getPixels(int, int, unsigned int,
unsigned int)


Any help is very apreciated, because i'm stuck on this.

Greetz
Timo
 
A

Andrew Koenig

// new Image
Image glyph(bitmap.width,bitmap.rows, "K", CharPixel, bitmap.buffer);
// this leads to the error:
unsigned int const c = buchstabe.columns;

It's hard to know without seeing your header files, but could you be
neglecting to call a function?

That is, could it be that you need to write something like this?

unsigned int const c = buchstabe.columns();

where the parentheses say to call the function?
 
J

JKop

Andrew Koenig posted:
It's hard to know without seeing your header files, but could you be
neglecting to call a function?

That is, could it be that you need to write something like this?

unsigned int const c = buchstabe.columns();

where the parentheses say to call the function?



This seems the likely cuplrit.

The other (but unlikely) possiblity is that "columns" is a member
variable which is a function pointer.


-JKop
 
B

Bob Hairgrove

Hi everybody,

when I try to compile a program that uses image Magick++ lib, I get the following error:

error: argument of type `unsigned int (Magick::Image::)()
const' does not match `const unsigned int'


here is the code:

// new Image
Image glyph(bitmap.width,bitmap.rows, "K", CharPixel, bitmap.buffer);
// this leads to the error:
unsigned int const c = buchstabe.columns;

My first attempt was to use:

PixelPacket *pixel_cache = glyph.getPixels(0,0,glyph.columns,glyph.rows);

but then I get the error:

error: no matching function for call to `Magick::Image::
getPixels(int, int, <unknown type>, <unknown type>)'
^^^^ ^^^^
Just a guess ... try this:

PixelPacket *pixel_cache =
glyph.getPixels(0,0,glyph.columns(),glyph.rows());
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top