找不到stdio.h [英] Cannot find stdio.h
问题描述
我正在使用macOS.
I am using macOS.
我正在尝试构建mozilla-central的代码.
I am trying to build the code of mozilla-central.
运行命令./mach build
时,编译在编译步骤失败.以下是相关的堆栈跟踪:
While running the command ./mach build
, the build fails at the compile step. Here are the relevant stack traces:
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
根据我的说法,根本原因是:
According to me, the root cause is:
/usr/local/Cellar/llvm/6.0.1/include/c++/v1/stdio.h:108:15: fatal error: 'stdio.h' file not found, err: true
在线列出的解决方案是使用以下命令安装xcode命令行工具:
The solution listed online was to install xcode command line tools using:
xcode-select --install
我已经做到了.
推荐答案
根本原因是由于缺少/usr/include
目录.
The root reason is due to a missing /usr/include
directory.
有时,安装命令行工具(xcode-select --install
)不会自动添加它.
Installing command-line tools (xcode-select --install
), sometimes, will not automatically add it.
链接显示了正确的方法: 安装命令行工具后 在以下位置安装软件包:
The Link shows the correct way: After installing command-line tools Install the package at:
# run this in Terminal
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
之后,
您应该具有包含头文件的目录/usr/include
you should have a directory /usr/include
with header files
这篇关于找不到stdio.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!