gpt4 book ai didi

C++编译错误: request for member ‘c_cflag' in something not a structure or union

转载 作者:太空宇宙 更新时间:2023-11-04 04:38:00 26 4
gpt4 key购买 nike

我尝试在 Debian 7 上编译 cp210x USB-UART 驱动程序并收到以下错误(当 make 命令时):

/var/distr/sillabs/Linux_3.x.x_VCP_Driver_Source/cp210x.c:589:17: error: request for member ‘c_cflag’ in something not a structure or union

这是代码片段,第 589 行(以 &tty-> 开头),cp210x.c:

static void cp210x_get_termios(struct tty_struct *tty,
struct usb_serial_port *port)
{
unsigned int baud;
if (tty) {
cp210x_get_termios_port(tty->driver_data,
&tty->termios.c_cflag, &baud);
tty_encode_baud_rate(tty, baud, baud);
} else {
unsigned int cflag;
cflag = 0;
cp210x_get_termios_port(port, &cflag, &baud);
}
}

我认为 &tty->termios.c_cflag 结构有问题。请帮忙如何解决?

谢谢!

最佳答案

这意味着在你的tty_struct定义中,termios是一个结构体指针,而不是一个结构体。您需要更改表达式

&tty->termios.c_cflag

&tty->termios->c_cflag

关于C++编译错误: request for member ‘c_cflag' in something not a structure or union,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29105058/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com