私は、独自の LISP ( http://www.buildyourownlisp.com/chapter4_interactive_prompt ) の構築に関するこのチュートリアルに取り組んでおり、何らかの理由でコンパイルしようとすると、次のようになります。
REPL.c:4:10: fatal error: 'editline/readline.h' file not found
#include <editline/history.h>
^
1 error generated.
macOS 開発者ツールをインストールしましたが、brew は readline がインストールされていることを示しており、brew install editline を試行しても何をすべきかわかりません。
これは私のコードです:
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <editline/readline.h>
4 #include <editline/history.h>
5
6 int main(int argc, char** argv) {
7
8 /* version/exit info */
9 puts("Edward Version 0.0.1");
10 puts("Press Ctrl+c to Exit\n");
11
12 /* endless loop for main REPL */
13 while (1) {
14 /* output prompt and read line */
15 char* input = readline("lispy> ");
16
17 /* put input in history */
18 add_history(input);
19
20 /* Echo input back */
21 printf("No you're a %s\n", input);
22
23 /* free input */
24 free(input);
25 }
26 return 0;
27 }
それは明らかに非常に基本的なことですが、私は本当にこのプロジェクトを進めたいと思っているので、これを理解できることを願っています. これは私がコンパイルするために使用しているものです:
cc -std=c99 -Wall REPL.c -ledit -o REPL