MacOS 13.5.2编译Joe/Jmacs编辑器报错该如何解决?
在Mac上编译安装jmacs编辑器(解决编译错误方案)
我偏爱Joe's Own Editor中的jmacs编辑器,但目前它没有原生Mac安装包,只能通过源码编译来使用。以下是完整的编译步骤,以及解决编译过程中报错的方法:
编译安装步骤
- 执行配置命令,指定安装路径:
./configure --prefix=/usr/local --sysconfdir=/etc
- 打开
tty.c文件进行编辑:
sudo vi joe/tty.c
- 在文件顶部附近添加如下头文件代码:
#include <util.h>
- 执行编译安装命令:
sudo LC_ALL=C make install
解决的编译错误
上述操作可以避免编译时出现以下关于未声明函数的错误:
tty.c:975:6: error: call to undeclared function 'openpty'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
if (openpty(ptyfd, ttyfd, name, NULL, NULL) == 0) { ^
tty.c:975:6: note: did you mean 'openat'?
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/fcntl.h:600:9: note: 'openat' declared here
int openat(int, const char *, int, ...) __DARWIN_NOCANCEL(openat) __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); ^
tty.c:1221:6: error: call to undeclared function 'login_tty'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
login_tty(1);
内容的提问来源于stack exchange,提问作者Andrew White
相关产品推荐
相关产品推荐

