gpt4 book ai didi

macos - 找不到stdio.h

转载 作者:行者123 更新时间:2023-12-04 02:30:51 28 4
gpt4 key购买 nike

我正在使用macOS。

我正在尝试构建mozilla-central的代码。

运行命令./mach build时,编译在编译步骤失败。以下是相关的堆栈跟踪:

stack backtrace:
0:20.24 0: 0x10436b5ff - std::sys::unix::backtrace::tracing::imp::unwind_backtrace::hed04c7a1477ef1e3
0:20.24 1: 0x10434499d - std::sys_common::backtrace::print::h336400f22676933f
0:20.24 2: 0x104373bd3 - std::panicking::default_hook::{{closure}}::h0d6700a02d682978
0:20.24 3: 0x10437395c - std::panicking::default_hook::h90363c6d6ac04260
0:20.24 4: 0x1043742fb - std::panicking::rust_panic_with_hook::h81c4f3add25e6667
0:20.24 5: 0x1043740ce - std::panicking::continue_panic_fmt::hfa057b7c1de88179
0:20.24 6: 0x104374020 - std::panicking::begin_panic_fmt::hd1123702300ea9f2
0:20.24 7: 0x1035f4e6d - build_script_build::build_gecko::bindings::write_binding_file::h2d9a397b93e6a614
0:20.24 8: 0x1035f651c - build_script_build::build_gecko::bindings::generate_bindings::ha066bc11b076e01d
0:20.24 9: 0x1043808fe - __rust_maybe_catch_panic
0:20.24 10: 0x1035eea9f - std::panicking::try::hcbd901ede6e8004c
0:20.32 11: 0x1035e335c - <F as alloc::boxed::FnBox<A>>::call_box::h638a7c5eb8c94414
0:20.33 12: 0x104373037 - std::sys_common::thread::start_thread::h78b1dd404be976ad
0:20.33 13: 0x1043436c8 - std::sys::unix::thread::Thread::new::thread_start::h27c6becca8cf44e0
0:20.33 14: 0x7fff636208cc - _pthread_body
0:20.33 15: 0x7fff6362083e - _pthread_start
0:20.33 /usr/local/Cellar/llvm/6.0.1/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found
0:20.33 /usr/local/Cellar/llvm/6.0.1/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found, err: true
0:20.37 thread '<unnamed>' panicked at 'Failed to generate bindings


据我说,根本原因是:

/usr/local/Cellar/llvm/6.0.1/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found, err: true


在线列出的解决方案是使用以下方法安装xcode命令行工具:

xcode-select --install


我已经做到了。

最佳答案

根本原因是由于缺少/usr/include目录。

有时,安装命令行工具(xcode-select --install)不会自动添加它。

Link显示正确的方法:
安装命令行工具后
在以下位置安装软件包:

# run this in Terminal
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg


之后,

您应该具有包含头文件的目录 /usr/include

关于macos - 找不到stdio.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51761599/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com