nenbutsu / kiss

a conforming ISLisp processor KISS
GNU General Public License v3.0
16 stars 1 forks source link

Compile error #3

Open Sasanidas opened 3 years ago

Sasanidas commented 3 years ago

I wasn't been able to compile the project, I have the required libraries installed and didn't modify the makefile: This is the backtrace: make -k

gcc  -O3 -o release/kiss release/array.o release/cf_invoke.o release/character.o release/control.o release/convert.o release/environment.o release/error.o release/feature.o release/format.o release/function.o release/gc.o release/gf_invoke.o release/hash_table.o release/ilos.o release/init.o release/inline.o release/invoke.o release/main.o release/misc.o release/number.o release/read.o release/repl.o release/sequence.o release/stream.o release/string.o release/symbol.o release/variable.o release/vector.o release/wcs.o -lm -lgmp
/usr/bin/ld: release/cf_invoke.o:(.bss+0x900): multiple definition of `KISS_Snil'; release/array.o:(.bss+0x900): first defined here
/usr/bin/ld: release/cf_invoke.o:(.bss+0x0): multiple definition of `KISS_Ssignal_condition'; release/array.o:(.bss+0x0): first defined here
/usr/bin/ld: release/cf_invoke.o:(.bss+0x40): multiple definition of `KISS_Sc_hash_table'; release/array.o:(.bss+0x40): first defined 0): first defined here
/usr/bin/ld: release/wcs.o:(.bss+0x900): multiple definition of `KISS_Snil'; release/array.o:(.bss+0x900): first defined here
/usr/bin/ld: release/wcs.o:(.bss+0x940): multiple definition of `KISS_St'; release/array.o:(.bss+0x940): first defined here
.....
collect2: error: ld returned 1 exit status
make: *** [makefile:32: release/kiss] Error 1
cp release/kiss .
cp: cannot stat 'release/kiss': No such file or directory
make: *** [makefile:29: release_cp] Error 1
make: Target 'all' not remade because of errors.

Also, my gcc version:

gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Is there anything I have to change to compile it?

Regards.

jpellegrini commented 2 years ago

The same happens here with GCC 11. It seems that variables are defined in kiss.h, and that file is included in several .c files. This probably worked in some specific C compilers, but GCC won't compile it (neither will CLANG). What about moving the definitions to a C file and leaving only declarations?