Build error with gcc 11
When trying to compile autotester on Ubuntu 22.04 or Fedora 35 with gcc 11, I encountered the following error after running make autotester
:
[CC] src/autotester.o....
[CC] src/autotesterlogfile.o....
[CC] src/call.o....
[CC] src/description.o....
[CC] src/integrationtest.o....
[CC] src/program.o....
[CC] src/resultdocument.o....
[CC] src/timeout.o....
[CC] src/validation.o....
[CC] src/variablescope.o....
[CC] src/xmlhelper.o....
[CC] lib/exception.o....
[CC] lib/fileop.o....
[CC] lib/parameter.o....
[CC] lib/parameter_base.o....
[CC] lib/wrapper.o....
[CC] lib/container/stringconv.o....
/usr/bin/ld: lib/parameter.o:(.bss+0x0): multiple definition of `paramtypes'; src/
autotester.o:(.bss+0x0): first defined here
/usr/bin/ld: lib/parameter_base.o:(.bss+0x0): multiple definition of `paramtypes';
src/autotester.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make: *** [makefile:41: autotester] Error 1
I don't know if it is the ideal solution, but I could fix this by moving the declaration of the variable paramtypes
from lib/parameter.h
to lib/parameter.c
.
I also propose to add some documentation on how to install dependencies on Red Hat based systems.
Any of those modifications can be modified or removed if they don't fit.