Page 1 of 1

make error like 'error: expected ';' after top level declarator'

Posted: 2018-10-28T18:10:03-07:00
by sangam
Hi all,
I need help and bug finding for solution for the issue I have got when trying to install ImageMagick. This comes when I enter 'make' command after the previous step for installation which is './configure'.

The error I got is:

Code: Select all

'png.c:148:24: error: expected ';' after top level declarator'
and
fatal error: too many errors emitted, stopping now
Full visible errors look as below:

Code: Select all

png.c:145:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_MHDR[5]={ 77,  72,  68,  82, '\0'};
                       ^
                       ;
png.c:146:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_BACK[5]={ 66,  65,  67,  75, '\0'};
                       ^
                       ;
png.c:147:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_BASI[5]={ 66,  65,  83,  73, '\0'};
                       ^
                       ;
png.c:148:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_CLIP[5]={ 67,  76,  73,  80, '\0'};
                       ^
                       ;
png.c:149:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_CLON[5]={ 67,  76,  79,  78, '\0'};
                       ^
                       ;
png.c:150:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_DEFI[5]={ 68,  69,  70,  73, '\0'};
                       ^
                       ;
png.c:151:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_DHDR[5]={ 68,  72,  68,  82, '\0'};
                       ^
                       ;
png.c:152:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_DISC[5]={ 68,  73,  83,  67, '\0'};
                       ^
                       ;
png.c:153:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_ENDL[5]={ 69,  78,  68,  76, '\0'};
                       ^
                       ;
png.c:154:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_FRAM[5]={ 70,  82,  65,  77, '\0'};
                       ^
                       ;
png.c:155:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_IEND[5]={ 73,  69,  78,  68, '\0'};
                       ^
                       ;
png.c:156:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_IHDR[5]={ 73,  72,  68,  82, '\0'};
                       ^
                       ;
png.c:157:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_JHDR[5]={ 74,  72,  68,  82, '\0'};
                       ^
                       ;
png.c:158:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_LOOP[5]={ 76,  79,  79,  80, '\0'};
                       ^
                       ;
png.c:159:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_MAGN[5]={ 77,  65,  71,  78, '\0'};
                       ^
                       ;
png.c:160:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_MEND[5]={ 77,  69,  78,  68, '\0'};
                       ^
                       ;
png.c:161:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_MOVE[5]={ 77,  79,  86,  69, '\0'};
                       ^
                       ;
png.c:162:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_PAST[5]={ 80,  65,  83,  84, '\0'};
                       ^
                       ;
png.c:163:24: error: expected ';' after top level declarator
static png_byte FARDATA mng_PLTE[5]={ 80,  76,  84,  69, '\0'};
Here is the details where I'm trying to install it in:

Code: Select all

PHP version: 5.6.30
OS: mac, Sierra
ImageMagick downloaded: Have tried, most of listed in 'https://sourceforge.net/projects/imagemagick/files/' 
Please let me know any further details I need to provide for my query. Thanks a lot.

Re: make error like 'error: expected ';' after top level declarator'

Posted: 2018-10-28T18:46:54-07:00
by fmw42
If you are installing from source, you need to install all the delegate libraries first, such as for PNG, JPG, TIFF etc. See https://imagemagick.org/download/delegates/.

Since you are installing on Mac OSX sierra, then you should probably install a binary from Homebrew or MacPorts for Sierra rather than install from source, since the binaries come with all the needed delegates.

Alternately, you can install all your delegates from say MacPorts first and then install IM from source. See https://www.imagemagick.org/discourse-s ... =1&t=29100