[Gate-users] error install lmf
David Boersma
david.boersma at acmit.at
Fri Dec 21 12:48:24 CET 2018
Dear Yuan Bo,
The LMF code is very old and is incompatible with modern compilers. But if you tell the compiler that it should use an old standard, then you will not get these errors. You can do this by adding "-std=c99" to the compiler flags for for *.c files, and "-std=c++98" for *.cc files. Lines 30-37 of the makefile would then look like this:
obj/%.o : src/%.c
gcc $(CFLAGS) -std=c99 -c -o $@ $<
obj/outputRootMgr.o : src/outputRootMgr.cc
gcc $(CFLAGS) $(ROOTCFLAGS) -std=c++98 -c -o $@ $<
obj/%.o : src/%.cc
gcc $(CFLAGS) -std=c++98 -c -o $@ $<
(Our mail programs are probably distorting the layout of this text. Please make sure that lines with "obj" are starting at the very beginning of the line, and lines starting with "gcc" should start with a TAB, and definitely not with normal spaces. Yes, the "make" grammar is a bit peculiar.)
With ROOT 5 and gcc version 7.3.0 this compiles on my machine. I did not try any other versions.
I hope that this helps you a little bit. Note that all this comes with VERY BIG DISCLAIMERS: I am not at all an LMF expert, and even though we provide the lmf tarball on our website, we do not officially support this. So I am not guaranteeing anything about whether the above will work. And even if it compiles, it may still run incorrectly: I did not test it... :-)
Good luck,
David Boersma
________________________________________
Von: Gate-users <gate-users-bounces at lists.opengatecollaboration.org> im Auftrag von 袁波 <gogenbyts at sina.com>
Gesendet: Freitag, 21. Dezember 2018 10:17:27
An: gate-users
Betreff: [Gate-users] error install lmf
dear gate user:
me again. the picture lost ,so i write the error as follow:
[-Wformat=]
printf("\nThis %llu", tTail);
^
src/oneList_flowchart.c:149:14: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘u64 {aka long unsigned int}’ [-Wformat=]
printf("\nis too old with this new %llu \n",
^
gcc -I./includes/ -D_FILE_OFFSET_BITS=64 -fPIC -D_64 -c -o obj/testField.o src/testField.c
src/testField.c: In function ‘testField’:
src/testField.c:53:12: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
if (*gets(reply) == 'y') {
^
src/testField.c:53:11: error: invalid type argument of unary ‘*’ (have ‘int’)
if (*gets(reply) == 'y') {
^
src/testField.c:89:6: error: invalid type argument of unary ‘*’ (have ‘int’)
if (*gets(reply) == 'y') {
^
makefile:31: recipe for target 'obj/testField.o' failed
make: *** [obj/testField.o] Error 1
yuanbo at yuanbo:~/gate/lmf/lmf_v3.0$
--------------------------------
From Yuan Bo
Zhengzhou University
No.100 Science Avenue,Zhengzhou City, Henan Province P.R.China
TEL:15263308323
来自袁波
郑州大学物理工程学院C楼4层核医学仪器实验室
河南省郑州市中原区科学大道100号
电话:15263308323
More information about the Gate-users
mailing list