c - 无法使用 <sys/times.h> ubuntu 进行编译

标签 c ubuntu

我安装了 64 位 ubuntu,并且正在尝试使用 times.h 编译代码,但是我不断收到 sys/times.h No such file or directory

到目前为止我已经尝试过
1.安装libc6-dev-i386、g++-multili、libc6和libc6-dev(即使已经安装)
2.我交换了<sys/times.h></usr/include/sys/times.h>现在我得到 features.h No such file or directory error

问题:
它接受</usr/include/sys/times.h>的方式很奇怪而不是<sys/times.h> ,还有帮助?

编辑:如果重要的话,我可以访问 times.h

最佳答案

我建议运行:

$ locate /sys/time.h | grep include

使用输出,您可以确定下一步要做什么:

  • 如果有一个名为 /usr/include/<x86_64 or i386>-linux-gnu/sys/time.h 的文件,然后只需运行:$ sudo ln -s /usr/include/<x86_64 or i386>-linux-gnu/sys /usr/include/sys 。如果编译器检查,这会将编译器定向到正确的文件。这似乎是您手动执行的操作。

  • 如果没有相关输出,请尝试下载 build-essential。可能还缺少其他东西。 $ sudo apt-get update; sudo apt-get install build-essential

请告诉我这是否有帮助!

关于c - 无法使用 <sys/times.h> ubuntu 进行编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42867679/

相关文章:

c - 在 C 语言中使用 poll() 作为 TCP 服务器

C静态变量

ubuntu - ARM 嵌入式的交叉编译

c# - Windows 应用程序和 Spy++

c - 使用比 ncurses 窗口更多的行

c - 打印数字时出现段错误

linux - 将目录中的文件数返回到 shell 脚本中的变量

tomcat - 同一台服务器中的两个 tomcat - Upstart Script Ubuntu Server

php - 如何让php和mysql使用不同的核心

python - 如何在 Ubuntu 中全局限制 python 对内核的使用?