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
MagickWand API Compilation Error
Re: MagickWand API Compilation Error
Did you use a command like this:
We tried contrast.c with ImageMagick 6.4.1 and it compiled without complaint.
- cc `MagickWand-config --cflags --cppflags` contrast.c `MagickWand-config --ldflags --libs`
We tried contrast.c with ImageMagick 6.4.1 and it compiled without complaint.
Re: MagickWand API Compilation Error
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.
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
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)
- static inline unsigned short RoundToQuantum(const float value)