使用 lua 的brew 安装,make 文件找不到 lua.h



我正试图从这里安装警报:https://web.tecgraf.puc-rio.br/lhf/ftp/lua/

我使用brew install lua在macOS上安装了lua

当我进入库目录进行编辑时,结果如下

%> make
gcc -std=c99 -Wall -Wextra -Wfatal-errors -O2 -I/usr/local/include -o alarm.so -bundle -undefined dynamic_lookup lalarm.c 
lalarm.c:12:10: fatal error: 'lua.h' file not found
#include "lua.h"
^~~~~~~
1 error generated.

homebrew在哪里安装lua.h文件?

我如何让它在默认情况下被make识别?

lua.h不在/usr/local/include中:

$ fd lua /usr/local/include
$ 

您需要配置CFLAGS以包含/opt/homebrew/Cellar/lua/5.4.4_1/include/lua:

$ fd lua.h /opt/homebrew/Cellar/lua/5.4.4_1
/opt/homebrew/Cellar/lua/5.4.4_1/include/lua/lua.h
/opt/homebrew/Cellar/lua/5.4.4_1/include/lua/lua.hpp
/opt/homebrew/Cellar/lua/5.4.4_1/include/lua5.4/lua.h
/opt/homebrew/Cellar/lua/5.4.4_1/include/lua5.4/lua.hpp