简体   繁体   English

config-temp/qemu-conf.c:1:10: 致命错误: sys/endian.h: 找不到文件或目录

[英]config-temp/qemu-conf.c:1:10: fatal error: sys/endian.h: File or directory not found

I would like to pass the integrated gpu from the host os (ubuntu 20.04) to the windows 10 guest os with xen.我想将集成的 gpu 从主机操作系统(ubuntu 20.04)传递到带有 xen 的 Windows 10 来宾操作系统。 This is because xen works great for me,better than qemu-kvm for my specific needs and because I have only two graphic cards.这是因为 xen 非常适合我,比 qemu-kvm 更适合我的特定需求,而且因为我只有两张显卡。 The nvidia rtx 2080 ti that I have already passed to the guest,and the intel UHD 630,that can be duplicated from the host to the guest so that it can be used in both places without interruptions.我已经传给guest的nvidia rtx 2080 ti和intel UHD 630,可以从host复制到guest,这样就可以在两个地方都使用而不会中断。 So I'm trying to build this repository :所以我正在尝试构建这个存储库:

https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#332-build-qemu--xen-for-xengt https://github.com/intel/gvt-linux/wiki/GVTg_Setup_Guide#33​​2-build-qemu--xen-for-xengt

exploring the log,I see this situation :浏览日志,我看到这种情况:

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]

It seems that the compilation stops because this :似乎编译停止是因为:

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

This is the qemu-conf.c file :这是 qemu-conf.c 文件:

root@ziomario-z390aoruspro:/etc/xen/igvtg-xen/tools/qemu-xen-build/config-temp# nano 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); }

Someone of you can help me to fix this bug ?你们中有人可以帮我修复这个错误吗? thanks.谢谢。

endian.h is normaly located directly under includes/ in linux. endian.h通常直接位于 linux 中的 includes/ 下。

You've got to have the glibc headers installed and change the source file(s) to #include <endian.h> instead.您必须安装 glibc 头文件并将源文件更改为#include <endian.h>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM