Mac上没有endian.h

本文指导如何在MacOS上安装Xcode Command Line Tools,包括通过Xcode偏好设置窗口和命令行方式安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在OS X上xcode默认没有安装command-line tools,根据xcode和OS X的版本,可以

(1). 在Xcode preferences->Downloads window安装command line tools

(2). 在命令行执行xcode-select --install

make -C …/…/ /root/bpf/linux-4.19.90/samples/bpf/ BPF_SAMPLES_PATH=/root/bpf/linux-4.19.90/samples/bpf make[1]: Entering directory ‘/root/bpf/linux-4.19.90’ CALL scripts/checksyscalls.sh DESCEND objtool make -C /root/bpf/linux-4.19.90/samples/bpf/…/…/tools/lib/bpf/ RM=‘rm -rf’ LDFLAGS= srctree=/root/bpf/linux-4.19.90/samples/bpf/…/…/ O= Warning: Kernel ABI header at ‘tools/include/uapi/linux/bpf.h’ differs from latest version at ‘include/uapi/linux/bpf.h’ CLANG-bpf /root/bpf/linux-4.19.90/samples/bpf/xdp_whitelist_kern.o In file included from /root/bpf/linux-4.19.90/samples/bpf/xdp_whitelist_kern.c:4: In file included from ./include/linux/tcp.h:24: ./include/net/inet_connection_sock.h:214:3: error: use of undeclared identifier ‘KBUILD_MODNAME’ pr_debug(“inet_csk BUG: unknown timer value\n”); ^ ./include/linux/printk.h:340:2: note: expanded from macro ‘pr_debug’ dynamic_pr_debug(fmt, ##VA_ARGS) ^ ./include/linux/dynamic_debug.h:125:2: note: expanded from macro ‘dynamic_pr_debug’ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); ^ ./include/linux/dynamic_debug.h:99:2: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’ DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, ^ ./include/linux/dynamic_debug.h:77:14: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’ .modname = KBUILD_MODNAME, ^ In file included from /root/bpf/linux-4.19.90/samples/bpf/xdp_whitelist_kern.c:4: In file included from ./include/linux/tcp.h:24: ./include/net/inet_connection_sock.h:228:3: error: use of undeclared identifier ‘KBUILD_MODNAME’ pr_debug(“reset_xmit_timer: sk=%p %d when=0x%lx, caller=%p\n”, ^ ./include/linux/printk.h:340:2: note: expanded from macro ‘pr_debug’ dynamic_pr_debug(fmt, ##VA_ARGS) ^ ./include/linux/dynamic_debug.h:125:2: note: expanded from macro ‘dynamic_pr_debug’ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); ^ ./include/linux/dynamic_debug.h:99:2: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’ DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, ^ ./include/linux/dynamic_debug.h:77:14: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’ .modname = KBUILD_MODNAME, ^ In file included from /root/bpf/linux-4.19.90/samples/bpf/xdp_whitelist_kern.c:4: In file included from ./include/linux/tcp.h:24: ./include/net/inet_connection_sock.h:244:3: error: use of undeclared identifier ‘KBUILD_MODNAME’ pr_debug(“inet_csk BUG: unknown timer value\n”); ^ ./include/linux/printk.h:340:2: note: expanded from macro ‘pr_debug’ dynamic_pr_debug(fmt, ##VA_ARGS) ^ ./include/linux/dynamic_debug.h:125:2: note: expanded from macro ‘dynamic_pr_debug’ DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); ^ ./include/linux/dynamic_debug.h:99:2: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA’ DEFINE_DYNAMIC_DEBUG_METADATA_KEY(name, fmt, .key.dd_key_false, ^ ./include/linux/dynamic_debug.h:77:14: note: expanded from macro ‘DEFINE_DYNAMIC_DEBUG_METADATA_KEY’ .modname = KBUILD_MODNAME, ^ 3 errors generated. make[1]: Leaving directory ‘/root/bpf/linux-4.19.90’
07-22
还有错误,如下:是不是要链接哪个静态库呢 In file included from packages/apps/zorro/neteq/include/rtc_base/logging.h:64: packages/apps/zorro/neteq/include/rtc_base/platform_thread_types.h:47:1: error: unknown type name 'PlatformThreadId' PlatformThreadId CurrentThreadId(); ^ packages/apps/zorro/neteq/include/rtc_base/platform_thread_types.h:52:1: error: unknown type name 'PlatformThreadRef' PlatformThreadRef CurrentThreadRef(); ^ packages/apps/zorro/neteq/include/rtc_base/platform_thread_types.h:55:29: error: unknown type name 'PlatformThreadRef' bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b); ^ packages/apps/zorro/neteq/include/rtc_base/platform_thread_types.h:55:57: error: unknown type name 'PlatformThreadRef' bool IsThreadRefEqual(const PlatformThreadRef& a, const PlatformThreadRef& b); ^ In file included from packages/apps/zorro/neteq/test1.cpp:18: In file included from packages/apps/zorro/neteq/include/rtc_base/logging.h:65: In file included from packages/apps/zorro/neteq/include/rtc_base/strings/string_builder.h:20: In file included from packages/apps/zorro/neteq/include/rtc_base/string_encode.h:24: packages/apps/zorro/neteq/include/rtc_base/string_to_number.h:95:43: warning: unused parameter 'base' [-Wunused-parameter] StringToNumber(absl::string_view str, int base = 10) { ^ In file included from packages/apps/zorro/neteq/test1.cpp:18: packages/apps/zorro/neteq/include/rtc_base/logging.h:121:18: error: use of undeclared identifier 'PlatformThreadId' absl::optional<PlatformThreadId> thread_id() const { return thread_id_; } ^ packages/apps/zorro/neteq/include/rtc_base/logging.h:137:37: error: use of undeclared identifier 'PlatformThreadId' void set_thread_id(absl::optional<PlatformThreadId> thread_id) { ^ packages/apps/zorro/neteq/include/rtc_base/logging.h:147:18: error: use of undeclared identifier 'PlatformThreadId' absl::optional<PlatformThreadId> thread_id_; ^ packages/apps/zorro/neteq/include/rtc_base/logging.h:460:39: warning: unused parameter 'streamer' [-Wunused-parameter] void operator&(LogStreamer<Ts...>&& streamer) {} ^ In file included from packages/apps/zorro/neteq/test1.cpp:23: In file included from packages/apps/zorro/neteq/include/rtc_base/physical_socket_server.h:14: In file included from packages/apps/zorro/neteq/include/api/async_dns_resolver.h:19: In file included from packages/apps/zorro/neteq/include/rtc_base/socket_address.h:20: In file included from packages/apps/zorro/neteq/include/rtc_base/ip_address.h:30: packages/apps/zorro/neteq/include/rtc_base/byte_order.h:96:2: error: "Missing byte order functions for this arch." #error "Missing byte order functions for this arch." ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:112:18: error: use of undeclared identifier 'htobe16' uint16_t val = htobe16(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:117:18: error: use of undeclared identifier 'htobe32' uint32_t val = htobe32(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:122:18: error: use of undeclared identifier 'htobe64' uint64_t val = htobe64(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:129:10: error: use of undeclared identifier 'be16toh' return be16toh(val); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:135:10: error: use of undeclared identifier 'be32toh' return be32toh(val); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:141:10: error: use of undeclared identifier 'be64toh' return be64toh(val); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:145:18: error: use of undeclared identifier 'htole16' uint16_t val = htole16(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:150:18: error: use of undeclared identifier 'htole32' uint32_t val = htole32(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:155:18: error: use of undeclared identifier 'htole64' uint64_t val = htole64(v); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:162:10: error: use of undeclared identifier 'le16toh' return le16toh(val); ^ packages/apps/zorro/neteq/include/rtc_base/byte_order.h:168:10: error: use of undeclared identifier 'le32toh' return le32toh(val); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 16 warnings and 20 errors generated. 16:57:36 ninja failed with: exit status 1
最新发布
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值