config-temp/qemu-conf.c :1:10: fatal error: sys/endian. h:找不到文件或目录

标签 c ubuntu compiler-errors compilation xen

我想将集成的 gpu 从主机操作系统(ubuntu 20.04)传递到带有 xen 的 windows 10 guest 操作系统。这是因为 xen 非常适合我,比 qemu-kvm 更适合我的特定需求,而且我只有两张显卡。我已经传给guest的nvidia rtx 2080 ti,和intel UHD 630,可以从host复制到guest,这样就可以在两个地方都使用,不会中断。所以我正在尝试构建这个存储库:
https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#332-build-qemu--xen-for-xengt
探索日志,我看到这种情况:

config-temp/qemu-conf.c:1:10: fatal error: sys/endian.h: File o directory non esistente
    1 | #include <sys/endian.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

/usr/bin/ld: /tmp/cc6WBNSk.o: in function `main':
/etc/xen/igvtg-xen/tools/qemu-xen-build/config-temp/qemu-conf.c:2: undefined reference to `sin'
collect2: error: ld returned 1 exit status

/usr/bin/ld: /tmp/ccEQrVtw.o: in function `main':
/etc/xen/igvtg-xen/tools/qemu-xen-build/config-temp/qemu-conf.c:4: undefined reference to `timer_create'
collect2: error: ld returned 1 exit status

config-temp/qemu-conf.c: In function ‘main’:
config-temp/qemu-conf.c:2:25: warning: null argument where non-null required (argument 1) [-Wnonnull]
    2 | int main(void) { return sem_timedwait(0, 0); }
      |                         ^~~~~~~~~~~~~
config-temp/qemu-conf.c:2:25: warning: null argument where non-null required (argument 2) [-Wnonnull]

config-temp/qemu-conf.c: In function ‘main’:
config-temp/qemu-conf.c:2:25: error: null argument where non-null required (argument 1) [-Werror=nonnull]
    2 | int main(void) { return sem_timedwait(0, 0); }
      |                         ^~~~~~~~~~~~~
config-temp/qemu-conf.c:2:25: error: null argument where non-null required (argument 2) [-Werror=nonnull]
似乎编译停止是因为:
config-temp/qemu-conf.c:1:10: fatal error: sys/endian.h: File o directory non esistente
    1 | #include <sys/endian.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
这是 qemu-conf.c 文件:
root@ziomario-z390aoruspro:/etc/xen/igvtg-xen/tools/qemu-xen-build/config-temp# nano qemu-conf.c
include <semaphore.h>
int main(void) { return sem_timedwait(0, 0); }
有人可以帮我修复这个错误吗?谢谢。

最佳答案

endian.h通常位于linux中的includes/下。
您必须安装 glibc 头文件并将源文件更改为 #include <endian.h>反而。

关于config-temp/qemu-conf.c :1:10: fatal error: sys/endian. h:找不到文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63604660/

相关文章:

c - 当您在 Linux 中更改进程所有权 (uid/gid) 时,已经打开的文件会发生什么情况?

python - 将 Linux 引导选项传递给 Init

linux - delphi alexandria linux 错误 ld-linux.exe : error: cannot find -lgcc_s

ubuntu - zsh中的有线字符

compiler-construction - CUDA 5.0,编译错误

java - 调用方法时,类中的构造方法无法应用于给定的类型错误

在 C Linux 中创建多个守护进程并在它们之间进行通信

c# - 从 C# 程序的 DLL 访问方法

apache 2.4 不会从/tmp 服务

android studio 找不到参数