Page 1 of 1

MagickWand API Compilation Error

Posted: 2008-05-12T12:36:11-07:00
by jcasique
Hi, I trying to create a demo progam (using website contrast.c example), but I got this error during the compilation

"/usr/local/include/ImageMagick/magick/quantum.h", line 101.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"/usr/local/include/ImageMagick/magick/quantum.h", line 100.8: 1506-485 (S) Parameter declaration list is incompatible with declarator for inline.
"/usr/local/include/ImageMagick/magick/quantum.h", line 130.28: 1506-045 (S) Undeclared identifier quantum.

Any comments

Re: MagickWand API Compilation Error

Posted: 2008-05-12T14:04:25-07:00
by magick
Did you use a command like this:
  • cc `MagickWand-config --cflags --cppflags` contrast.c `MagickWand-config --ldflags --libs`
Can you post which version of ImageMagick you are using and 10 or so lines around line 101 of quantum.h.

We tried contrast.c with ImageMagick 6.4.1 and it compiled without complaint.

Re: MagickWand API Compilation Error

Posted: 2008-05-13T05:58:19-07:00
by jcasique
I'm using IM 6.4.1

Here some lines from quantum.h

+67 typedef struct _QuantumInfo
+68 {
+69 unsigned long
+70 quantum;
+71
+72 QuantumFormatType
+73 format;
+74
+75 double
+76 minimum,
+77 maximum,
+78 scale;
+79
+80 size_t
+81 pad;
+82
+83 MagickBooleanType
+84 min_is_white,
+85 pack;
+86
+87 unsigned char
+88 *pixels;
+89
+90 size_t
+91 extent;
+92
+93 SemaphoreInfo
+94 *semaphore;
+95
+96 unsigned long
+97 signature;
+98 } QuantumInfo;
+99
+100 static inline Quantum RoundToQuantum(const MagickRealType value)
+101 {
+102 #if defined(MAGICKCORE_HDRI_SUPPORT)
+103 return((Quantum) value);
+104 #else
+105 if (value <= 0.0)
+106 return((Quantum) 0);
+107 if (value >= QuantumRange)
+108 return((Quantum) QuantumRange);
+109 return((Quantum) (value+0.5));
+110 #endif
+111 }

Using this command:
cc `MagickWand-config --cflags --cppflags` constrant.c `MagickWand-config --ldflags --libs`

I got the same error

"/usr/local/include/ImageMagick/magick/quantum.h", line 101.1: 1506-277 (S) Syntax error: possible missing ';' or ','?
"/usr/local/include/ImageMagick/magick/quantum.h", line 100.8: 1506-485 (S) Parameter declaration list is incompatible with declarator for inline.
"/usr/local/include/ImageMagick/magick/quantum.h", line 130.28: 1506-045 (S) Undeclared identifier quantum.

Re: MagickWand API Compilation Error

Posted: 2008-05-13T06:39:12-07:00
by magick
Seems you have a contrary compiler. What OS are you using? Which compiler? Which version? Change line 100 to
  • static inline unsigned short RoundToQuantum(const double value)
Does the compiler still complain? Does it complain for
  • static inline unsigned short RoundToQuantum(const float value)