Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
-
- Posts: 8
- Joined: 2017/10/10 16:09:26
Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
As soon as i upgraded to centos 7.4, i was not able to compile any packages. Whether it was python package , ffmpeg, gcc,..
The issue is generally on fresh install of 7.4
All packages give the same error: "error: expected ‘,’ or ‘;’ before ‘typedef’"
sample output when trying to compile ffmpeg:
sudo make V=1
gcc -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I./compat/float -I./compat/atomics/gcc -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c11 -fomit-frame-pointer -pthread -D_REENTRANT -I/usr/include/SDL2 -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized -MMD -MF libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o libavdevice/alldevices.o libavdevice/alldevices.c
In file included from /usr/include/math.h:46:0,
from ./libavutil/common.h:36,
from ./libavutil/avutil.h:296,
from ./libavutil/log.h:25,
from libavdevice/avdevice.h:48,
from libavdevice/alldevices.c:23:
/usr/include/bits/mathdef.h:28:1: error: expected ‘,’ or ‘;’ before ‘typedef’
typedef float float_t; /* `float' expressions are evaluated as `float'. */
^
make: *** [libavdevice/alldevices.o] Error 1
The issue is generally on fresh install of 7.4
All packages give the same error: "error: expected ‘,’ or ‘;’ before ‘typedef’"
sample output when trying to compile ffmpeg:
sudo make V=1
gcc -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I./compat/float -I./compat/atomics/gcc -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c11 -fomit-frame-pointer -pthread -D_REENTRANT -I/usr/include/SDL2 -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized -MMD -MF libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o libavdevice/alldevices.o libavdevice/alldevices.c
In file included from /usr/include/math.h:46:0,
from ./libavutil/common.h:36,
from ./libavutil/avutil.h:296,
from ./libavutil/log.h:25,
from libavdevice/avdevice.h:48,
from libavdevice/alldevices.c:23:
/usr/include/bits/mathdef.h:28:1: error: expected ‘,’ or ‘;’ before ‘typedef’
typedef float float_t; /* `float' expressions are evaluated as `float'. */
^
make: *** [libavdevice/alldevices.o] Error 1
Last edited by darksniperx on 2017/10/10 18:25:30, edited 1 time in total.
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
Please provide the output of
rpm -q glibc-headers
rpm -V glibc-headers (this may be empty)
rpm -q glibc-headers
rpm -V glibc-headers (this may be empty)
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
Also, unable to reproduce:
Code: Select all
$ cat test.c
#include <stdio.h>
#include <math.h>
int main(int argc, char *argv[]) {
printf("Hello world\n");
return 0;
}
$ make test
cc test.c -o test
$ ./test
Hello world
$ rpm -q glibc glibc-headers gcc make
glibc-2.17-196.el7.x86_64
glibc-headers-2.17-196.el7.x86_64
gcc-4.8.5-16.el7.x86_64
make-3.82-23.el7.x86_64
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
I tried to reproduce too and failed though mine helloworld.c also included the same typedef float float_t; line from the original report.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 8
- Joined: 2017/10/10 16:09:26
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
Forgot to mention, the issue is generally on fresh install of 7.4
rpm -q glibc-headers: glibc-headers-2.17-196.el7.x86_64
rpm -V glibc-headers: (blank)
rpm -q glibc glibc-headers gcc make:
glibc-2.17-196.el7.x86_64
glibc-2.17-196.el7.i686
glibc-headers-2.17-196.el7.x86_64
gcc-4.8.5-16.el7.x86_64
make-3.82-23.el7.x86_64
rpm -q glibc-headers: glibc-headers-2.17-196.el7.x86_64
rpm -V glibc-headers: (blank)
rpm -q glibc glibc-headers gcc make:
glibc-2.17-196.el7.x86_64
glibc-2.17-196.el7.i686
glibc-headers-2.17-196.el7.x86_64
gcc-4.8.5-16.el7.x86_64
make-3.82-23.el7.x86_64
Last edited by darksniperx on 2017/10/10 18:25:06, edited 1 time in total.
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
Just trying to help, found this thread interesting my default 7.4 shows following:
Not sure if this helps or not.
Code: Select all
[dlazov@zovs-centos7 hello]$ make test
cc test.c -o test
[dlazov@zovs-centos7 hello]$ ./test
Hello world
[dlazov@zovs-centos7 hello]$ rpm -q glibc glibc-headers gcc make
glibc-2.17-196.el7.x86_64
glibc-headers-2.17-196.el7.x86_64
gcc-4.8.5-16.el7.x86_64
make-3.82-23.el7.x86_64
Red, Green, Refactor...
-
- Posts: 8
- Joined: 2017/10/10 16:09:26
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
if i follow the hello world example, there is no issue, although gcc still fails to make whole app like ffmpeg :
steps to repro the issue:
steps to repro the issue:
Code: Select all
wget http://ffmpeg.org/releases/ffmpeg-3.3.4.tar.bz2
tar -xvjf ffmpeg-3.3.4.tar.bz2
cd ffmpeg-3.3.4
./configure
make
========
CC libavdevice/alldevices.o
In file included from /usr/include/math.h:46:0,
from ./libavutil/common.h:36,
from ./libavutil/avutil.h:296,
from ./libavutil/log.h:25,
from libavdevice/avdevice.h:48,
from libavdevice/alldevices.c:23:
/usr/include/bits/mathdef.h:28:1: error: expected ‘,’ or ‘;’ before ‘typedef’
typedef float float_t; /* `float' expressions are evaluated as `float'. */
^
make: *** [libavdevice/alldevices.o] Error 1
==============
make V=1
gcc -I. -I./ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I./compat/float -I./compat/atomics/gcc -DZLIB_CONST -DHAVE_AV_CONFIG_H -std=c11 -fomit-frame-pointer -pthread -D_REENTRANT -I/usr/include/SDL2 -g -Wdeclaration-after-statement -Wall -Wdisabled-optimization -Wpointer-arith -Wredundant-decls -Wwrite-strings -Wtype-limits -Wundef -Wmissing-prototypes -Wno-pointer-to-int-cast -Wstrict-prototypes -Wempty-body -Wno-parentheses -Wno-switch -Wno-format-zero-length -Wno-pointer-sign -O3 -fno-math-errno -fno-signed-zeros -fno-tree-vectorize -Werror=format-security -Werror=implicit-function-declaration -Werror=missing-prototypes -Werror=return-type -Werror=vla -Wformat -fdiagnostics-color=auto -Wno-maybe-uninitialized -MMD -MF libavdevice/alldevices.d -MT libavdevice/alldevices.o -c -o libavdevice/alldevices.o libavdevice/alldevices.c
In file included from /usr/include/math.h:46:0,
from ./libavutil/common.h:36,
from ./libavutil/avutil.h:296,
from ./libavutil/log.h:25,
from libavdevice/avdevice.h:48,
from libavdevice/alldevices.c:23:
/usr/include/bits/mathdef.h:28:1: error: expected ‘,’ or ‘;’ before ‘typedef’
typedef float float_t; /* `float' expressions are evaluated as `float'. */
^
make: *** [libavdevice/alldevices.o] Error 1
Last edited by darksniperx on 2017/10/10 18:58:44, edited 1 time in total.
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
Is this just ffmpeg?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
-
- Posts: 8
- Joined: 2017/10/10 16:09:26
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
The issue is with everything that i try to compile, gcc, pip packages, locust, etc,...
example compiling gcc 7.2:
example compiling vlc:
example compiling gcc 7.2:
Code: Select all
make
...
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating testsuite/Makefile
config.status: creating config.h
config.status: executing default commands
make[3]: Entering directory `/tmp/gcc-7.2.0/host-x86_64-pc-linux-gnu/libiberty'
if [ x"-fpic" != x ] && [ ! -d pic ]; then \
mkdir pic; \
else true; fi
touch stamp-picdir
if [ x"" != x ] && [ ! -d noasan ]; then \
mkdir noasan; \
else true; fi
touch stamp-noasandir
if [ x"-fpic" != x ]; then \
gcc -c -DHAVE_CONFIG_H -g -I. -I../.././libiberty/../include -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -pedantic -D_GNU_SOURCE -fpic ../.././libiberty/regex.c -o pic/regex.o; \
else true; fi
In file included from ../.././libiberty/../include/xregex.h:27:0,
from ../.././libiberty/regex.c:194:
../.././libiberty/../include/xregex2.h:45:1: error: expected ‘,’ or ‘;’ before ‘typedef’
typedef long int s_reg_t;
^
make[3]: *** [regex.o] Error 1
make[3]: Leaving directory `/tmp/gcc-7.2.0/host-x86_64-pc-linux-gnu/libiberty'
make[2]: *** [all-stage1-libiberty] Error 2
make[2]: Leaving directory `/tmp/gcc-7.2.0'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/tmp/gcc-7.2.0'
make: *** [all] Error 2
Code: Select all
[amaximovskih@abstrusenesses vlc-2.2.6]$ make
make all-recursive
make[1]: Entering directory `/tmp/vlc-2.2.6'
Making all in compat
make[2]: Entering directory `/tmp/vlc-2.2.6/compat'
make all-am
make[3]: Entering directory `/tmp/vlc-2.2.6/compat'
CC dummy.lo
CC atof.lo
In file included from ../include/vlc_fixups.h:70:0,
from ../config.h:801,
from atof.c:22:
/usr/include/dirent.h:263:1: error: expected ‘,’ or ‘;’ before ‘extern’
extern int __REDIRECT (scandir,
^
.....
Last edited by darksniperx on 2017/10/10 19:28:18, edited 1 time in total.
Re: Unable to compile on centos 7.4 : error: expected ‘,’ or ‘;’ before ‘typedef’
I used your "steps to reproduce" on my usual fully updated CentOS 7.4 build machine, and ffmpeg built just fine (with a few warnings).
Even though you have the normal CentOS C compiler installed, are you actually using it? What does which gcc show?
Even though you have the normal CentOS C compiler installed, are you actually using it? What does which gcc show?