Fatal error: 'stdarg.h' file not found

So I'm trying to generate bindings for a C++ library, wxWidgets...

Here is my wrapper.hpp:

#include <wx/wx.h>

Here is my build.rs:

use std::path::PathBuf;
use std::process::Command;

fn main() {
	println!("cargo:rustc-link-lib=wxWidgets");
	println!("cargo:rerun-if-changed=wrapper.hpp");

	// Beyond just the include paths, the flags returned by `wx-config` include
	// important target definitions that tell wxWidgets what platform it's on,
	// which means we really need those flags!
	//
	// Here's what they are on my system as an example:
	//   -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1
	//   -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__
	//   -D__WXOSX__ -pthread
	//
	// Other than the include paths, that includes `WXUSINGDLL`,
	// `__WXOSX_COCOA__`, `__WXMAC__`, and `__WXOSX__`! Also the include paths
	// are kind of important to be able to detect dynamically!
	let cxx_flags = Command::new("wx-config")
		.arg("--cxxflags")
		.output()
		.expect("Couldn't get flags! Ensure you have `wx-config` in your PATH!");

	let cxx_flags = String::from_utf8(cxx_flags.stdout).unwrap();
	let cxx_flags = cxx_flags + " -std=c++14";

	// It's apparently impossible to define this programmatically, so I have to
	// abuse this environment variable meant to be used by the user!
	std::env::set_var(
		"BINDGEN_EXTRA_CLANG_ARGS",
		std::env::var("BINDGEN_EXTRA_CLANG_ARGS")
			.map(|str| str + " " + cxx_flags.as_ref())
			.unwrap_or(cxx_flags)
	);

	let bindings = bindgen::Builder::default()
		.header("wrapper.hpp")
		.derive_default(true)
		.parse_callbacks(Box::new(bindgen::CargoCallbacks))
		.generate()
		.expect("Couldn't make bindings!");

	let out_path = PathBuf::from(std::env::var("OUT_DIR").unwrap());
	bindings.write_to_file(out_path.join("bindings.rs"))
		.expect("Couldn't write bindings!");
}

I've managed to fix many issues with my compiler toolchain up to this point, but right now I have no idea what to do!

Here's the error it gives me:

/Users/LoganDark/.cargo/bin/cargo build --color=always
   Compiling wxRust v0.1.0 (/Users/LoganDark/CLionProjects/wxRust/wxRust-sys)
error: failed to run custom build command for `wxRust v0.1.0 (/Users/LoganDark/CLionProjects/wxRust/wxRust-sys)`

Caused by:
  process didn't exit successfully: `/Users/LoganDark/CLionProjects/wxRust/target/debug/build/wxRust-0a9230353732ad92/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=wxWidgets
cargo:rerun-if-changed=wrapper.hpp

--- stderr
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/wchar.h:89:10: fatal error: 'stdarg.h' file not found
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/wchar.h:89:10: fatal error: 'stdarg.h' file not found, err: true
thread 'main' panicked at 'Couldn't make bindings!: ()', wxRust-sys/build.rs:37:20

But, I know my LLVM_CONFIG_PATH is set to /usr/local/opt/llvm/bin/llvm-config, so I can run it myself and find out what clang is being used!

0 LoganDark ~ /usr/local/opt/llvm/bin/llvm-config --bindir
/usr/local/Cellar/llvm/10.0.0_3/bin

And from that I can find out the include paths!

0 LoganDark ~ /usr/local/Cellar/llvm/10.0.0_3/bin/clang -E -Wp,-v -
clang -cc1 version 10.0.0 based upon LLVM 10.0.0 default target x86_64-apple-darwin18.7.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
End of search list.

And from that I can find...

0 LoganDark ~ find /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -name stdarg.h
/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include/stdarg.h

...

What?

stdarg.h is right here! And clang searches it by default!

Okay fine, let me set an environment variable CPLUS_INCLUDE_PATH to the include chain (/usr/local/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks)... Maybe that's the issue?

Nope!

/usr/local/include/wx-3.1/wx/stringimpl.h:66:10: fatal error: 'string' file not found

What the heck? Now it can't resolve #include <string>? But I included the -std=c++14 flag!

I've been trying to solve this issue since yesterday, and I've posted questions in #rust-usage and #beginners in the Discord, but nobody answered. Eventually I got told to move my question here, since "everyone is volunteers and they probably don't want to answer your question or something" (???)

So, does anyone here know enough about this magic compiler stuff to help me out...?

macOS 10.14.6

Graveyard of things I've tried:

  • Uninstalling/reinstalling developer tools, aka the xcode-select --install method... they don't even have anything to do with my LLVM install, so it didn't do anything
  • Everything on the first few pages of google
  • Installing header files (as you can see it's trivial to find stdarg.h, but the compiler doesn't find it for some reason!)
  • Ensuring bindgen is using the same clang (it is, it uses the exact same llvm-config as the one I invoked to find clang for my own investigation)
1 Like

It would be good to isolate if this is a problem with bindgen or with clang.

Enable a logger in your build script, for example env_logger. Set the log level to debug to get the output of this debug message: lib.rs.html -- source

The clang_args field should contain exactly the arguments passed to clang by bindgen. If you run clang yourself using those arguments, do you get the same error? If so, see what changes you need to make to get it to work.

[2020-07-19T06:17:09Z DEBUG bindgen] Found clang: Clang { path: "/usr/local/Cellar/llvm/10.0.0_3/bin/clang", version: Some(CXVersion { Major: 10, Minor: 0, Subminor: 0 }), c_search_paths: None, cpp_search_paths: Some(["/usr/local/include", "/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1", "/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include", "/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks"]) }
[2020-07-19T06:17:09Z DEBUG bindgen] Fixed-up options: BindgenOptions { blacklisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, blacklisted_items: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, opaque_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustfmt_path: None, whitelisted_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_functions: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, whitelisted_vars: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_enum_style: Consts, bitfield_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, newtype_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, rustified_non_exhaustive_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enum_modules: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, constified_enums: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, default_alias_style: TypeAlias, type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, new_type_alias_deref: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, builtins: false, emit_ast: false, emit_ir: false, emit_ir_graphviz: None, enable_cxx_namespaces: false, enable_function_attribute_detection: false, disable_name_namespacing: false, disable_nested_struct_naming: false, disable_header_comment: false, layout_tests: true, impl_debug: false, impl_partialeq: false, derive_copy: true, derive_debug: true, derive_default: true, derive_hash: false, derive_partialord: false, derive_ord: false, derive_partialeq: false, derive_eq: false, use_core: false, ctypes_prefix: None, time_phases: false, namespaced_constants: true, msvc_mangling: false, convert_floats: true, raw_lines: [], module_lines: {}, clang_args: ["-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1", "-I/usr/local/include/wx-3.1", "-DWXUSINGDLL", "-D__WXOSX_COCOA__", "-D__WXMAC__", "-D__WXOSX__", "-pthread", "-std=c++14", "wrapper.hpp"], input_header: Some("wrapper.hpp"), input_unsaved_files: [], parse_callbacks: Some(CargoCallbacks), codegen_config: FUNCTIONS | TYPES | VARS | METHODS | CONSTRUCTORS | DESTRUCTORS, conservative_inline_namespaces: false, generate_comments: true, generate_inline_functions: false, whitelist_recursively: true, objc_extern_crate: false, generate_block: false, block_extern_crate: false, enable_mangling: true, detect_include_paths: true, prepend_enum_name: true, rust_target: Stable_1_40, rust_features: RustFeatures { untagged_union: true, associated_const: true, builtin_clone_impls: true, repr_align: true, i128_and_u128: true, must_use_function: true, repr_transparent: true, min_const_fn: true, core_ffi_c_void: true, repr_packed_n: true, maybe_uninit: true, non_exhaustive: true, thiscall_abi: false }, record_matches: true, size_t_is_usize: false, rustfmt_bindings: true, rustfmt_configuration_file: None, no_partialeq_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_copy_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, no_hash_types: RegexSet { items: [], matched: [], set: Some(RegexSet([])), record_matches: true }, array_pointers_in_arguments: false, wasm_import_module_name: None }

Here are the args:

clang_args: ["-I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1", "-I/usr/local/include/wx-3.1", "-DWXUSINGDLL", "-D__WXOSX_COCOA__", "-D__WXMAC__", "-D__WXOSX__", "-pthread", "-std=c++14", "wrapper.hpp"]

So, I invoked the exact same clang with the exact same args and guess what:

0 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
/usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -std=c++14 wrapper.hpp
0 LoganDark ~/CLionProjects/wxRust/wxRust-sys ls
Cargo.lock        Cargo.toml        build.rs          cmake-build-debug src               wrapper.hpp       wrapper.hpp.gch
0 LoganDark ~/CLionProjects/wxRust/wxRust-sys 

It successfully built the file.

Either this is an issue with bindgen or an issue with the environment build.rs is run in. Here are my environment variables:

0 LoganDark ~/CLionProjects/wxRust/wxRust-sys env
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.9wQUXtPZgx/Render
CPLUS_INCLUDE_PATH=/usr/local/include/
C_INCLUDE_PATH=/usr/local/include/
DBUS_LAUNCHD_SESSION_BUS_SOCKET=/private/tmp/com.apple.launchd.K4xw5doFLX/unix_domain_listener
DISPLAY=/private/tmp/com.apple.launchd.YV1QHRokDF/org.macosforge.xquartz:0
GEM_PATH=
GPG_TTY=/dev/ttys001
HOME=/Users/LoganDark
HOMEBREW_NO_AUTO_UPDATE=true
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home
LC_CTYPE=en_US.UTF-8
LESSOPEN=|/usr/local/bin/lesspipe.sh %s
LESS_ADVANCED_PREPROCESSOR=1
LOGIN_SHELL=1
LOGNAME=LoganDark
NVM_DIR=/Users/LoganDark/.nvm
PATH=/bin:/Users/LoganDark/.bin:/usr/local/bin:/Users/LoganDark/emsdk/emscripten/1.38.20:/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/bin:/Users/LoganDark/google-cloud-sdk/bin:/Users/LoganDark/.nvm/versions/node/v10.1.0/bin:/Users/LoganDark/.cargo/bin:/etc/pypy/bin:/Users/LoganDark/go/bin:/usr/local/opt/unzip/bin:/opt/metasploit-framework/bin:/Users/LoganDark/.nvm/versions/node/v7.6.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin:/Users/LoganDark/.rvm/bin
PWD=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
SHELL=/usr/local/bin/fish
SHLVL=2
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.10lo8NNrHz/Listeners
TERM=xterm-256color
TERMINAL_EMULATOR=JetBrains-JediTerm
TMPDIR=/var/folders/b4/nhbpmdnn2rj3g_y6509yf_bw0000gn/T/
TOOLBOX_VERSION=1.17.6802
USER=LoganDark
XPC_FLAGS=0x0
XPC_SERVICE_NAME=com.jetbrains.CLion.139032.0C6FB93B-8F38-473E-B1B7-B386E91E8683
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
__INTELLIJ_COMMAND_HISTFILE__=/Users/LoganDark/Library/Application Support/JetBrains/CLion2020.1/terminal/history/history-68
rvm_bin_path=/Users/LoganDark/.rvm/bin
rvm_delete_flag=0
rvm_path=/Users/LoganDark/.rvm
rvm_prefix=/Users/LoganDark
rvm_ruby_string=system
rvm_version=1.29.10-next master

Here are build.rs environment variables:

Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.9wQUXtPZgx/Render
CARGO=/Users/LoganDark/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo
CARGO_CFG_TARGET_ARCH=x86_64
CARGO_CFG_TARGET_ENDIAN=little
CARGO_CFG_TARGET_ENV=
CARGO_CFG_TARGET_FAMILY=unix
CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,sse3,ssse3
CARGO_CFG_TARGET_OS=macos
CARGO_CFG_TARGET_POINTER_WIDTH=64
CARGO_CFG_TARGET_VENDOR=apple
CARGO_CFG_UNIX=
CARGO_HOME=/Users/LoganDark/.cargo
CARGO_MAKEFLAGS=--jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
CARGO_MANIFEST_DIR=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
CARGO_PKG_AUTHORS=LoganDark
CARGO_PKG_DESCRIPTION=
CARGO_PKG_HOMEPAGE=
CARGO_PKG_NAME=wxRust
CARGO_PKG_REPOSITORY=
CARGO_PKG_VERSION=0.1.0
CARGO_PKG_VERSION_MAJOR=0
CARGO_PKG_VERSION_MINOR=1
CARGO_PKG_VERSION_PATCH=0
CARGO_PKG_VERSION_PRE=
CLANG_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/clang
CPLUS_INCLUDE_PATH=/usr/local/include/
C_INCLUDE_PATH=/usr/local/include/
DBUS_LAUNCHD_SESSION_BUS_SOCKET=/private/tmp/com.apple.launchd.K4xw5doFLX/unix_domain_listener
DEBUG=true
DISPLAY=/private/tmp/com.apple.launchd.YV1QHRokDF/org.macosforge.xquartz:0
GEM_PATH=
GPG_TTY=not a tty
HOME=/Users/LoganDark
HOMEBREW_NO_AUTO_UPDATE=true
HOST=x86_64-apple-darwin
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home
LC_CTYPE=en_US.UTF-8
LESSOPEN=|/usr/local/bin/lesspipe.sh %s
LESS_ADVANCED_PREPROCESSOR=1
LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config
LOGNAME=LoganDark
NUM_JOBS=8
NVM_DIR=/Users/LoganDark/.nvm
OPT_LEVEL=0
OUT_DIR=/Users/LoganDark/CLionProjects/wxRust/target/debug/build/wxRust-02e3376420c73a7c/out
PATH=/Users/LoganDark/.cargo/bin:/Users/LoganDark/.rvm/bin:/Users/LoganDark/.bin:/usr/local/bin:/Users/LoganDark/emsdk/emscripten/1.38.20:/Library/Java/JavaVirtualMachines/jdk1.8.0_212.jdk/Contents/Home/bin:/Users/LoganDark/google-cloud-sdk/bin:/Users/LoganDark/.nvm/versions/node/v10.1.0/bin/:/Users/LoganDark/.cargo/bin:/etc/pypy/bin:/Users/LoganDark/go/bin:/usr/local/opt/unzip/bin:/opt/metasploit-framework/bin:/Users/LoganDark/.nvm/versions/node/v7.6.0/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/go/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Library/TeX/texbin
PROFILE=debug
PWD=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
RUSTC=rustc
RUSTDOC=rustdoc
RUSTUP_HOME=/Users/LoganDark/.rustup
RUSTUP_TOOLCHAIN=stable-x86_64-apple-darwin
RUST_BACKTRACE=short
RUST_RECURSION_COUNT=1
SHELL=/usr/local/bin/fish
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.10lo8NNrHz/Listeners
TARGET=x86_64-apple-darwin
TERM=ansi
TMPDIR=/var/folders/b4/nhbpmdnn2rj3g_y6509yf_bw0000gn/T/
TOOLBOX_VERSION=1.17.6802
USER=LoganDark
VERSIONER_PYTHON_PREFER_32_BIT=no
VERSIONER_PYTHON_VERSION=2.7
XPC_FLAGS=0x0
XPC_SERVICE_NAME=com.jetbrains.CLion.139032.0C6FB93B-8F38-473E-B1B7-B386E91E8683
__CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0

I've tried messing with these. Various things break the build but setting CPLUS_INCLUDE_PATH manually to include the right paths cause this message, like in the original post:

/usr/local/include/wx-3.1/wx/stringimpl.h:66:10: fatal error: 'string' file not found

I really can't tell if this is a step forwards, or a step backwards. I don't know if this is included before or after stdarg.h. I'm positive -std=c++14 is included in the arguments now because I can see it right there.

Your PATH is also different, not sure if it matters.

Yes, I also tried only adding parts of PATH containing executables that it complained about not having. That didn't work...

Clangs I've tried (with LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config:

  • CLANG_PATH=/usr/bin/clang, /usr/bin/clang++
    • Default search paths (clang -E -Wp,-v -):
      #include <...> search starts here:
       /usr/local/include
       /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include
       /Library/Developer/CommandLineTools/usr/include
       /usr/include
       /System/Library/Frameworks (framework directory)
       /Library/Frameworks (framework directory)
      End of search list.
      
    • With CPLUS_INCLUDE_PATH=/usr/local/include:/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include:/Library/Developer/CommandLineTools/usr/include:/usr/include:/System/Library/Frameworks:/Library/Frameworks:
      • CARGO=/Users/LoganDark/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo
        CARGO_CFG_TARGET_ARCH=x86_64
        CARGO_CFG_TARGET_ENDIAN=little
        CARGO_CFG_TARGET_ENV=
        CARGO_CFG_TARGET_FAMILY=unix
        CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,sse3,ssse3
        CARGO_CFG_TARGET_OS=macos
        CARGO_CFG_TARGET_POINTER_WIDTH=64
        CARGO_CFG_TARGET_VENDOR=apple
        CARGO_CFG_UNIX=
        CARGO_HOME=/Users/LoganDark/.cargo
        CARGO_MAKEFLAGS=--jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
        CARGO_MANIFEST_DIR=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        CARGO_PKG_AUTHORS=LoganDark
        CARGO_PKG_DESCRIPTION=
        CARGO_PKG_HOMEPAGE=
        CARGO_PKG_NAME=wxRust
        CARGO_PKG_REPOSITORY=
        CARGO_PKG_VERSION=0.1.0
        CARGO_PKG_VERSION_MAJOR=0
        CARGO_PKG_VERSION_MINOR=1
        CARGO_PKG_VERSION_PATCH=0
        CARGO_PKG_VERSION_PRE=
        CLANG_PATH=/usr/bin/clang
        CPLUS_INCLUDE_PATH=/usr/local/include:/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include:/Library/Developer/CommandLineTools/usr/include:/usr/include:/System/Library/Frameworks:/Library/Frameworks
        DEBUG=true
        HOST=x86_64-apple-darwin
        LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config
        NUM_JOBS=8
        OPT_LEVEL=0
        OUT_DIR=/Users/LoganDark/CLionProjects/wxRust/target/debug/build/wxRust-02e3376420c73a7c/out
        PATH=/Users/LoganDark/.cargo/bin:/usr/local/Cellar/llvm/10.0.0_3/bin:/usr/local/bin:/usr/bin
        PROFILE=debug
        PWD=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        RUSTC=rustc
        RUSTDOC=rustdoc
        RUSTUP_HOME=/Users/LoganDark/.rustup
        RUSTUP_TOOLCHAIN=stable-x86_64-apple-darwin
        RUST_BACKTRACE=short
        RUST_RECURSION_COUNT=1
        TARGET=x86_64-apple-darwin
        TERM=ansi
        __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
        
  • /usr/local/Cellar/llvm/10.0.0_3/bin/clang
    • #include <...> search starts here:
       /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include
       /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
       /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
      End of search list.
      
    • CPLUS_INCLUDE_PATH=/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
      • CARGO=/Users/LoganDark/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo
        CARGO_CFG_TARGET_ARCH=x86_64
        CARGO_CFG_TARGET_ENDIAN=little
        CARGO_CFG_TARGET_ENV=
        CARGO_CFG_TARGET_FAMILY=unix
        CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,sse3,ssse3
        CARGO_CFG_TARGET_OS=macos
        CARGO_CFG_TARGET_POINTER_WIDTH=64
        CARGO_CFG_TARGET_VENDOR=apple
        CARGO_CFG_UNIX=
        CARGO_HOME=/Users/LoganDark/.cargo
        CARGO_MAKEFLAGS=--jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
        CARGO_MANIFEST_DIR=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        CARGO_PKG_AUTHORS=LoganDark
        CARGO_PKG_DESCRIPTION=
        CARGO_PKG_HOMEPAGE=
        CARGO_PKG_NAME=wxRust
        CARGO_PKG_REPOSITORY=
        CARGO_PKG_VERSION=0.1.0
        CARGO_PKG_VERSION_MAJOR=0
        CARGO_PKG_VERSION_MINOR=1
        CARGO_PKG_VERSION_PATCH=0
        CARGO_PKG_VERSION_PRE=
        CLANG_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/clang
        CPLUS_INCLUDE_PATH=/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
        DEBUG=true
        HOST=x86_64-apple-darwin
        LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config
        NUM_JOBS=8
        OPT_LEVEL=0
        OUT_DIR=/Users/LoganDark/CLionProjects/wxRust/target/debug/build/wxRust-02e3376420c73a7c/out
        PATH=/Users/LoganDark/.cargo/bin:/usr/local/Cellar/llvm/10.0.0_3/bin:/usr/local/bin:/usr/bin
        PROFILE=debug
        PWD=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        RUSTC=rustc
        RUSTDOC=rustdoc
        RUSTUP_HOME=/Users/LoganDark/.rustup
        RUSTUP_TOOLCHAIN=stable-x86_64-apple-darwin
        RUST_BACKTRACE=short
        RUST_RECURSION_COUNT=1
        TARGET=x86_64-apple-darwin
        TERM=ansi
        __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
        
  • /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang
    • #include <...> search starts here:
       /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include
       /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include
       /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks (framework directory)
      End of search list.
      
    • CPLUS_INCLUDE_PATH=/usr/local/include:/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks
      • CARGO=/Users/LoganDark/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo
        CARGO_CFG_TARGET_ARCH=x86_64
        CARGO_CFG_TARGET_ENDIAN=little
        CARGO_CFG_TARGET_ENV=
        CARGO_CFG_TARGET_FAMILY=unix
        CARGO_CFG_TARGET_FEATURE=fxsr,sse,sse2,sse3,ssse3
        CARGO_CFG_TARGET_OS=macos
        CARGO_CFG_TARGET_POINTER_WIDTH=64
        CARGO_CFG_TARGET_VENDOR=apple
        CARGO_CFG_UNIX=
        CARGO_HOME=/Users/LoganDark/.cargo
        CARGO_MAKEFLAGS=--jobserver-fds=3,4 -j --jobserver-auth=3,4 -j
        CARGO_MANIFEST_DIR=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        CARGO_PKG_AUTHORS=LoganDark
        CARGO_PKG_DESCRIPTION=
        CARGO_PKG_HOMEPAGE=
        CARGO_PKG_NAME=wxRust
        CARGO_PKG_REPOSITORY=
        CARGO_PKG_VERSION=0.1.0
        CARGO_PKG_VERSION_MAJOR=0
        CARGO_PKG_VERSION_MINOR=1
        CARGO_PKG_VERSION_PATCH=0
        CARGO_PKG_VERSION_PRE=
        CLANG_PATH=/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang
        CPLUS_INCLUDE_PATH=/usr/local/include:/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks
        DEBUG=true
        HOST=x86_64-apple-darwin
        LLVM_CONFIG_PATH=/usr/local/opt/llvm/bin/llvm-config
        NUM_JOBS=8
        OPT_LEVEL=0
        OUT_DIR=/Users/LoganDark/CLionProjects/wxRust/target/debug/build/wxRust-02e3376420c73a7c/out
        PATH=/Users/LoganDark/.cargo/bin:/usr/local/Cellar/llvm/10.0.0_3/bin:/usr/local/bin:/usr/bin
        PROFILE=debug
        PWD=/Users/LoganDark/CLionProjects/wxRust/wxRust-sys
        RUSTC=rustc
        RUSTDOC=rustdoc
        RUSTUP_HOME=/Users/LoganDark/.rustup
        RUSTUP_TOOLCHAIN=stable-x86_64-apple-darwin
        RUST_BACKTRACE=short
        RUST_RECURSION_COUNT=1
        TARGET=x86_64-apple-darwin
        TERM=ansi
        __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0
        

And every single one of those with LLVM_CONFIG_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/llvm-config:

  • /usr/bin/clang, /usr/bin/clang++: no worky
  • /usr/local/Cellar/llvm/10.0.0_3/bin/clang: no worky
  • /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang: no worky

With LLVM_CONFIG_PATH=/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/llvm-config:

  • /usr/bin/clang, /usr/bin/clang++: no worky
  • /usr/local/Cellar/llvm/10.0.0_3/bin/clang: no worky
  • /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang: no worky

HERE ARE FLAG COMBOS!

  • /usr/bin/clang, /usr/bin/clang++:
    • -std=c++14: fatal error: 'string' file not found
    • -std=c++11: fatal error: 'string' file not found
    • -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++14 -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++11 -stdlib=libc++: fatal error: 'string' file not found
    • -libc++: fatal error: 'string' file not found
    • -std=c++14 -libc++: fatal error: 'string' file not found
    • -std=c++11 -libc++: fatal error: 'string' file not found
  • /usr/local/Cellar/llvm/10.0.0_3/bin/clang:
    • -std=c++14: fatal error: 'string' file not found
    • -std=c++11: fatal error: 'string' file not found
    • -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++14 -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++11 -stdlib=libc++: fatal error: 'string' file not found
    • -libc++: fatal error: 'string' file not found
    • -std=c++14 -libc++: fatal error: 'string' file not found
    • -std=c++11 -libc++: fatal error: 'string' file not found
  • /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang:
    • -std=c++14: fatal error: 'string' file not found
    • -std=c++11: fatal error: 'string' file not found
    • -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++14 -stdlib=libc++: fatal error: 'string' file not found
    • -std=c++11 -stdlib=libc++: fatal error: 'string' file not found
    • -libc++: fatal error: 'string' file not found
    • -std=c++14 -libc++: fatal error: 'string' file not found
    • -std=c++11 -libc++: fatal error: 'string' file not found

I literally have no idea what to do. They are ALL erroring on this line:

include string

So, tell me, if every compiler on my system cannot find the standard library and every combination of flags doesn't make them work... how can I compile anything at all? Homebrew?

And why does it work differently when I invoke the commands manually?!

Examples:

1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/usr/local/include:/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include:/Library/Developer/CommandLineTools/usr/include:/usr/include:/System/Library/Frameworks:/Library/Frameworks /usr/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/local/include -isystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include -isystem /Library/Developer/CommandLineTools/usr/include -isystem /usr/include -isystem /System/Library/Frameworks -isystem /Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string:500:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/string_view:176:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/__string:56:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:640:
In file included from /Library/Developer/CommandLineTools/usr/include/c++/v1/initializer_list:47:
/Library/Developer/CommandLineTools/usr/include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: library not found for -libc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/usr/local/include:/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/usr/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h'
      file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

Meanwhile, stddef.h is, uh...

1 LoganDark ~ find /usr/local/Cellar -iname stddef.h
/usr/local/Cellar/llvm/10.0.0_3/include/c++/v1/stddef.h
/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include/stddef.h
/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/include/c++/v1/stddef.h
/usr/local/Cellar/llvm/10.0.0_3/Toolchains/LLVM10.0.0.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h

everywhere.

1 LoganDark ~ find /usr/include -iname stddef.h
/usr/include/stddef.h
0 LoganDark ~ find /Library/Developer -iname stddef.h
/Library/Developer/CommandLineTools/usr/include/c++/v1/stddef.h
/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/stddef.h
/Library/Developer/CommandLineTools/usr/lib/tapi/10.0.1/include/stddef.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stddef.h
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/stddef.h
/Library/Developer/CommandLineTools/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Clang/include/stddef.h

Everywhere.

These dumb compilers, keep telling me that they can't find something that's literally everywhere on the system, and definitely in their include paths. And when running in bindgen, they keep telling me they can't find the standard library even though every single one can when invoked from a shell.

I have no idea how this is so broken, but I really need help fixing it.

Here's me trying to use this issue comment, but to no avail:

1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/:/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/:/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -isystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/ wrapper.hpp
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env C_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/ CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/:/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -isystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/ wrapper.hpp 
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env C_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/ CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/:/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -isystem /Library/Developer/CommandLineTools/usr/lib/clang/10.0.1/include/ wrapper.hpp 
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
1 LoganDark ~/CLionProjects/wxRust/wxRust-sys 
env C_INCLUDE_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/clang CPLUS_INCLUDE_PATH=/usr/local/Cellar/llvm/10.0.0_3/bin/clang:/usr/include:/usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include:/usr/local/include:/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include /usr/local/Cellar/llvm/10.0.0_3/bin/clang -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.1 -I/usr/local/include/wx-3.1 -DWXUSINGDLL -D__WXOSX_COCOA__ -D__WXMAC__ -D__WXOSX__ -pthread -libc++ -isystem /usr/include -isystem /usr/local/Cellar/llvm/10.0.0_3/lib/clang/10.0.0/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks -isystem /usr/local/Cellar/llvm/10.0.0_3/bin/clang wrapper.hpp 
In file included from wrapper.hpp:8:
In file included from /usr/local/include/wx-3.1/wx/wx.h:15:
In file included from /usr/local/include/wx-3.1/wx/object.h:19:
In file included from /usr/local/include/wx-3.1/wx/memory.h:15:
In file included from /usr/local/include/wx-3.1/wx/string.h:37:
In file included from /usr/local/include/wx-3.1/wx/strvararg.h:19:
In file included from /usr/local/include/wx-3.1/wx/unichar.h:15:
In file included from /usr/local/include/wx-3.1/wx/stringimpl.h:66:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string:504:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/string_view:175:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/__string:57:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/algorithm:639:
In file included from /usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/initializer_list:46:
/usr/local/Cellar/llvm/10.0.0_3/bin/../include/c++/v1/cstddef:44:15: fatal error: 'stddef.h' file not found
#include_next <stddef.h>
              ^~~~~~~~~~
1 error generated.
ld: unknown option: -platform_version
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)

I've opened an issue on the bindgen repo

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.