0

I recently tested an IPhone application, written in Swift, with XCode using the built-in iPhone Simulator.

Since then I get compile errors when I try to build any Rust project, even after updating Rust with rustup. There are warnings too which mention the iOS Simulator. I'm not familiar with the C or XCode toolchains, so I'm not sure what is the best way to fix it or how to prevent this happening again in the future.

Note: my Rust projects are not targeting iOS.

Here's what happens with a new project:

$ cargo new test1
$ cd test1
$ cargo build
   Compiling test1 v0.1.0 (file:///Users/peter/dev/test1)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-m64" "-L" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.1y16o1qfye96o7m0.rcgu.o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.3k2zkvohnahk04y3.rcgu.o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.3rngp6bm2u2q5z0y.rcgu.o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.4oc10dk278mpk1vy.rcgu.o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.4xq48u46a1pwiqn7.rcgu.o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.oa3rad818d8sgn4.rcgu.o" "-o" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e" "/Users/peter/dev/test1/target/debug/deps/test1-7fe1ce40b6cf488e.crate.allocator.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/Users/peter/dev/test1/target/debug/deps" "-L" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-5a05d0933700ddb1.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-64fd20ce4af6fbad.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_system-2c5b1969da7ded68.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-c80953af6722fea1.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2ed0d380199e717d.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-8c87fbf7e0bce62b.rlib" "/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-9b97130153f6d410.rlib" "-l" "System" "-l" "resolv" "-l" "pthread" "-l" "c" "-l" "m"
  = note: ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(jemalloc.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(jemalloc.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(state.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(state.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(fileline.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(fileline.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(arena.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(arena.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(base.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(base.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk_dss.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk_dss.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(ctl.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(ctl.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(huge.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(huge.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(mutex.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(mutex.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(util.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(util.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(tsd.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(tsd.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(tcache.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(tcache.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(stats.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(stats.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(pages.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(pages.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(prof.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(prof.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(quarantine.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(quarantine.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(witness.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(witness.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(alloc.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(alloc.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(macho.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(macho.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(posix.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(posix.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(bitmap.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(bitmap.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk_mmap.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(chunk_mmap.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(ckh.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(ckh.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(extent.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(extent.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(nstime.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(nstime.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(rtree.pic.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc_jemalloc-3913d194bc6184af.rlib(rtree.pic.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(dwarf.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(dwarf.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(read.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(read.o)) was built for newer OSX version (10.7) than being linked (8.0)
          ld: warning: URGENT: building for iOS simulator, but linking in object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(sort.o)) built for OSX. Note: This will be an error in the future.
          ld: warning: object file (/Users/peter/.rustup/toolchains/1.27.1-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-73671a9242f94467.rlib(sort.o)) was built for newer OSX version (10.7) than being linked (8.0)
          Undefined symbols for architecture x86_64:
            "_opendir$INODE64", referenced from:
                _macho_try_dsym in libstd-73671a9242f94467.rlib(macho.o)
                _macho_add in libstd-73671a9242f94467.rlib(macho.o)
            "_readdir$INODE64", referenced from:
                _macho_try_dsym in libstd-73671a9242f94467.rlib(macho.o)
                _macho_add in libstd-73671a9242f94467.rlib(macho.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: Could not compile `test1`.

CC:

$ cc --version
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

GCC:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/c++/4.2.1
Apple LLVM version 9.1.0 (clang-902.0.39.2)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Rust:

$ rustup show active-toolchain
1.27.1-x86_64-apple-darwin

Other information:

$ echo $SDKROOT
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk

$ echo $DEVELOPER_DIR
/Applications/Xcode.app/Contents/Developer

$ xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk

$ xcode-select -p
/Applications/Xcode.app/Contents/Developer

I found this Rust issue, which sounds similar, but it's very old and also resolved:

4

1 回答 1

1

You have overridden $SDKROOT to use the iPhone Simulator SDK. One simple fix would be undefining it before invoking the C compiler, which should make it use the macOS SDK instead.

$ export SDKROOT=
$ cargo build
于 2018-07-11T14:09:07.557 回答