gpt4 book ai didi

c++ - 如何为 安装库?

转载 作者:行者123 更新时间:2023-12-03 06:54:01 33 4
gpt4 key购买 nike

我正在运行 Kali-Linux (debian+gnome)。编译时出现编译错误:

cc -Wall -g   -c -o frag.o frag.c
frag.c:7:10: fatal error: stropts.h: No such file or directory
7 | #include <stropts.h>
| ^~~~~~~~~~~
compilation terminated.
make: *** [<builtin>: frag.o] Error 1

谁能告诉我我缺少什么以及我应该安装什么?
我尝试安装 glibc-sources,但仍然没有成功。

最佳答案

正如另一个答案所提到的,这个库不在 Linux 上使用。由于这是在 Linux 上尝试编译应用程序时出现的,因此可能是 #if没有正确设置。
作为解决方法,查看源代码以了解 #if周边#include是,并在编译时将其设置为 false。
例如,如果代码如下所示:

#if HAVE_STROPTS_H
#include <stropts.h>
#endif
如果您使用的是 cmake 或 gcc,请使用 -DHAVE_STROPTS_H=0 运行它们.

关于c++ - 如何为 <stropts.h> 安装库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61029226/

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