【发布时间】:2016-03-22 03:11:27
【问题描述】:
我使用的是更新升级的ubuntu 14.0.4LTS。
我已经编写了串行通信的代码。
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <time.h>
#include <errno.h>
#include <sys/stat.h>
#include <termios.h>
以上文件已包含在代码中。
当我编译代码时,它返回错误“O_RDWR undeclared” 如果我包含 fcntl.h,则编译器返回错误“参数类型 1 不兼容”,这意味着打开的函数需要 const char* 类型的参数。
struct termios TtyN;
open( TtyN, O_RDWR );
类型转换不合适。什么是正确的解决方案?
【问题讨论】:
-
你可以尝试添加#include
然后尝试
标签: c ubuntu terminal ubuntu-14.04