我正在尝试使用命令ninja -C build为ESP目标构建qemu。我在macOS上查找标准库时出错。我想我错过了一些额外的路径变量,但我不知道什么。我已经尝试了多种可能的解决方案,可在网络上,但似乎没有帮助。
> ninja -C build
^~~~~~~~
1 error generated.
[4/1471] Compiling C object tests/plugin/libsyscall.dylib.p/syscall.c.o
FAILED: tests/plugin/libsyscall.dylib.p/syscall.c.o
cc -Itests/plugin/libsyscall.dylib.p -Itests/plugin -I../tests/plugin -I../include/qemu -I/usr/local/Cellar/glib/2.74.5/include -I/usr/local/Cellar/glib/2.74.5/include/glib-2.0 -I/usr/local/Cellar/glib/2.74.5/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.42/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O0 -g -iquote . -iquote /Users/flying_raijin/espressif/qemu -iquote /Users/flying_raijin/espressif/qemu/include -iquote /Users/flying_raijin/espressif/qemu/tcg/aarch64 -fsanitize=undefined -fsanitize=address -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong -MD -MQ tests/plugin/libsyscall.dylib.p/syscall.c.o -MF tests/plugin/libsyscall.dylib.p/syscall.c.o.d -o tests/plugin/libsyscall.dylib.p/syscall.c.o -c ../tests/plugin/syscall.c
../tests/plugin/syscall.c:13:10: fatal error: 'glib.h' file not found
#include <glib.h>
^~~~~~~~
1 error generated.
[5/1471] Compiling C object tests/plugin/libmem.dylib.p/mem.c.o
FAILED: tests/plugin/libmem.dylib.p/mem.c.o
cc -Itests/plugin/libmem.dylib.p -Itests/plugin -I../tests/plugin -I../include/qemu -I/usr/local/Cellar/glib/2.74.5/include -I/usr/local/Cellar/glib/2.74.5/include/glib-2.0 -I/usr/local/Cellar/glib/2.74.5/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre2/10.42/include -fcolor-diagnostics -Wall -Winvalid-pch -std=gnu11 -O0 -g -iquote . -iquote /Users/flying_raijin/espressif/qemu -iquote /Users/flying_raijin/espressif/qemu/include -iquote /Users/flying_raijin/espressif/qemu/tcg/aarch64 -fsanitize=undefined -fsanitize=address -DOS_OBJECT_USE_OBJC=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wno-initializer-overrides -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-string-plus-int -Wno-typedef-redefinition -Wno-tautological-type-limit-compare -Wno-psabi -Wno-gnu-variable-sized-type-not-at-end -fstack-protector-strong -MD -MQ tests/plugin/libmem.dylib.p/mem.c.o -MF tests/plugin/libmem.dylib.p/mem.c.o.d -o tests/plugin/libmem.dylib.p/mem.c.o -c ../tests/plugin/mem.c
../tests/plugin/mem.c:13:10: fatal error: 'glib.h' file not found
#include <glib.h>
^~~~~~~~
1条答案
按热度按时间omqzjyyz1#
我的问题出在Hombrew上。似乎当我将我的Mac从英特尔迁移到M1时,Hombrew在
/usr/local/bin
处被复制,但Mac上的Hombrew的预期路径是/opt/hombrew/bin
。我使用www.example.com卸载了Hombrewhttps://github.com/homebrew/install#uninstall-homebrew
然后使用www.example.com重新安装Hombrewhttps://github.com/homebrew/install#install-homebrew-on-macos-or-linux,然后我就成功地构建了QEMU。