seven1m / malcc Goto Github PK
View Code? Open in Web Editor NEWMal (Make A Lisp) Compiler in C
Home Page: https://mpov.timmorgan.org/i-built-a-lisp-compiler/
License: MIT License
Mal (Make A Lisp) Compiler in C
Home Page: https://mpov.timmorgan.org/i-built-a-lisp-compiler/
License: MIT License
Can't compile code from master: redefinition of BLANK_LINE
$ make all -j1
gcc -Itinycc -Wall -Wextra -Werror -g -c -o step0_repl.o step0_repl.c
gcc step0_repl.o -ledit -ltermcap -lgc -lpcre -ldl -o step0_repl
gcc -Itinycc -Wall -Wextra -Werror -g -c -o step1_read_print.o step1_read_print.c
gcc -Itinycc -Wall -Wextra -Werror -g -c -o hashmap.o hashmap.c
gcc -Itinycc -Wall -Wextra -Werror -g -c -o printer.o printer.c
gcc -Itinycc -Wall -Wextra -Werror -g -c -o reader.o reader.c
gcc -Itinycc -Wall -Wextra -Werror -g -c -o types.o types.c
gcc -Itinycc -Wall -Wextra -Werror -g -c -o util.o util.c
gcc step1_read_print.o hashmap.o printer.o reader.o types.o util.o -ledit -ltermcap -lgc -lpcre -ldl -o step1_read_print
/usr/bin/ld: printer.o:/tmp/malcc/printer.h:7: повторное определение «BLANK_LINE»; step1_read_print.o:/tmp/malcc/printer.h:7: здесь первое определение
/usr/bin/ld: reader.o:/tmp/malcc/printer.h:7: повторное определение «BLANK_LINE»; step1_read_print.o:/tmp/malcc/printer.h:7: здесь первое определение
/usr/bin/ld: types.o:/tmp/malcc/printer.h:7: повторное определение «BLANK_LINE»; step1_read_print.o:/tmp/malcc/printer.h:7: здесь первое определение
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
make: *** [<встроенное>: step1_read_print] Ошибка 1
My workaround:
diff --git a/printer.h b/printer.h
index 5b2674b..bbf4ce0 100644
--- a/printer.h
+++ b/printer.h
@@ -4,7 +4,7 @@
#include "hashmap.h"
#include "types.h"
-char *BLANK_LINE;
+extern char *BLANK_LINE;
char* pr_atom(MalType *val, int print_readably);
char* pr_str(MalType *val, int print_readably);
(END)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.