Closed nthu9280 closed 5 years ago
can you run this and paste the output?:
gcc -M -MG lsirec.c
Please see be output below.
` gcc -M -MG lsirec.c lsirec.o: lsirec.c /usr/include/stdc-predef.h /usr/include/stdio.h \ /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ /usr/include/gnu/stubs-64.h \ /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stddef.h \ /usr/include/bits/types.h /usr/include/bits/typesizes.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdarg.h \ /usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \ /usr/include/string.h /usr/include/xlocale.h \ /usr/lib/gcc/x86_64-redhat-linux/4.8.5/include/stdint.h \ /usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/sys/mman.h \ /usr/include/bits/mman.h /usr/include/sys/types.h /usr/include/time.h \ /usr/include/endian.h /usr/include/bits/endian.h \ /usr/include/bits/byteswap.h /usr/include/bits/byteswap-16.h \ /usr/include/sys/select.h /usr/include/bits/select.h \ /usr/include/bits/sigset.h /usr/include/bits/time.h \ /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ /usr/include/sys/stat.h /usr/include/bits/stat.h \ /usr/include/sys/errno.h /usr/include/errno.h /usr/include/bits/errno.h \ /usr/include/linux/errno.h /usr/include/asm/errno.h \ /usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \ /usr/include/sys/user.h /usr/include/fcntl.h /usr/include/bits/fcntl.h \ /usr/include/bits/fcntl-linux.h /usr/include/unistd.h \ /usr/include/bits/posix_opt.h /usr/include/bits/environments.h \ /usr/include/bits/confname.h /usr/include/getopt.h
`
updated the make file -std=gnu99 resolved the issue and was able to successfully compile it.
` make cc -std=gnu99 -Wall -O2 lsirec.c -o lsirec
[root@rhel01 lsirec]# ls LICENSE lsirec lsirec.c Makefile README.md sample_sbr sbrtool.py
[root@rhel01 lsirec]# ./lsirec --help
Usage: ./lsirec
I'm getting compile errors. I've added -std=c99 to avoid the "for’ loop initial declarations are only allowed in c99 mode" issue
`
~~ make
cc -std=c99 -Wall -O2 lsirec.c -o lsirec lsirec.c: In function ‘lsi_setup_hcdw’: lsirec.c:261:32: error: ‘MAP_ANONYMOUS’ undeclared (first use in this function) MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB|MAP_LOCKED, 0, 0); ^ lsirec.c:261:32: note: each undeclared identifier is reported only once for each function it appears in lsirec.c:261:46: error: ‘MAP_HUGETLB’ undeclared (first use in this function) MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB|MAP_LOCKED, 0, 0); ^ lsirec.c:261:58: error: ‘MAP_LOCKED’ undeclared (first use in this function) MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB|MAP_LOCKED, 0, 0); ^ lsirec.c: In function ‘i2c_delay’: lsirec.c:394:5: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration] usleep(5); ^ make: *** [lsirec] Error 1
uname -r 3.10.0-957.5.1.el7.x86_64
`