2017-08-11 2 views
-1

OpenBSD 6.1で自分のコードを構築しようとしましたが、このエラーメッセージが表示されます。OpenBSD 6.1 termio.h:そのようなファイルやディレクトリがありません

sh.h:98:20: error: termio.h: No such file or directory 
In file included from edit.c:1: 
sh.h:235: error: conflicting types for 'rlim_t' 
/usr/include/sys/types.h:145: error: previous declaration of 'rlim_t' was here 
In file included from edit.c:1: 
sh.h:2291: warning: 'struct termio' declared inside parameter list 
sh.h:2291: warning: its scope is only this definition or declaration, which is probably not what you want 
edit.c: In function 'x_mode': 
edit.c:3256: error: invalid use of undefined type 'struct termio' 
edit.c:3256: error: 'VERASE' undeclared (first use in this function) 
edit.c:3256: error: (Each undeclared identifier is reported only once 
edit.c:3256: error: for each function it appears in.) 
edit.c:3256: error: invalid use of undefined type 'struct termio' 
edit.c:3257: error: invalid use of undefined type 'struct termio' 
edit.c:3257: error: 'VKILL' undeclared (first use in this function) 
edit.c:3257: error: invalid use of undefined type 'struct termio' 
edit.c:3258: error: invalid use of undefined type 'struct termio' 
edit.c:3258: error: 'VINTR' undeclared (first use in this function) 
edit.c:3258: error: invalid use of undefined type 'struct termio' 
edit.c:3259: error: invalid use of undefined type 'struct termio' 
edit.c:3259: error: 'VQUIT' undeclared (first use in this function) 
edit.c:3259: error: invalid use of undefined type 'struct termio' 
edit.c:3260: error: invalid use of undefined type 'struct termio' 
edit.c:3260: error: 'VEOF' undeclared (first use in this function) 
edit.c:3260: error: invalid use of undefined type 'struct termio' 
edit.c:3293: error: 'TCSETAW' undeclared (first use in this function) 
*** Error 1 in src (Makefile:774 'edit.o') 
*** Error 1 in . (Makefile:834 'all-recursive') 
*** Error 1 in /root/opsh (Makefile:750 'all') 
# pkg_add termios 
quirks-2.304 signed on 2017-04-02T15:01:33Z 
Can't find termios 
# pkg_add termios 
# termios 
ksh: termios: not found 
# termio 
ksh: termio: not found 
# pkg_add libc6-dev 
quirks-2.304 signed on 2017-04-02T15:01:33Z 
Can't find libc6-dev 
# pkg_add libc6  
quirks-2.304 signed on 2017-04-02T15:01:33Z 
Can't find libc6 
# 

どうすればよいですか?コードはUbuntu 1604でコンパイルされます。

答えて

2

<termio.h>ヘッダーは、Linuxでも使用できますが、標準ではありません。標準ヘッダーはPOSIX <termios.h>です。私のUbuntu 16.04 LTS VMイメージで

、ファイルは、その全体が、含まれています

/* Compatible <termio.h> for old `struct termio' ioctl interface. 
    This is obsolete; use the POSIX.1 `struct termios' interface 
    defined in <termios.h> instead. */ 

#include <termios.h> 
#include <sys/ioctl.h> 

あなたは非標準のヘッダを使用する場合は、他のシステム上でそれらを見つけることがない期待することができます。上記の情報を使用して<termio.h>のコピーを自分で作成することができます。あなたは幸運にも、BSD <sys/ioctl.h>(存在します)に必要な情報が含まれていることがわかりますが、POSIXによって標準化されたヘッダではないので、すべてのベットはオフです。 <termios.h>の標準シンボルのみを使用している場合は、安全です。

関連する問題