【问题标题】:config-temp/qemu-conf.c:1:10: fatal error: sys/endian.h: File or directory not foundconfig-temp/qemu-conf.c:1:10:致命错误:sys/endian.h:找不到文件或目录
【发布时间】:2020-08-26 19:39:25
【问题描述】:

我想通过 xen 将集成 gpu 从主机操作系统 (ubuntu 20.04) 传递到 windows 10 来宾操作系统。这是因为 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); }

有人可以帮我修复这个错误吗?谢谢。

【问题讨论】:

    标签: c ubuntu compiler-errors compilation xen


    【解决方案1】:

    endian.h 通常直接位于linux中的includes/下。

    您必须安装 glibc 头文件并将源文件更改为 #include &lt;endian.h&gt;。

    【讨论】:

    猜你喜欢
    • 2015-01-20
    • 1970-01-01
    • 2019-07-21
    • 2019-03-07
    • 1970-01-01
    • 2016-06-19
    • 2020-12-31
    • 1970-01-01
    • 2019-09-01
    相关资源
    最近更新 更多