Mac OS错误中弃用了i386架构错误

时间:2018-12-04 10:12:18

标签: ios xcode clang

我对Mac环境完全陌生,仅使用了几个小时。运行shell脚本时,出现以下错误-

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/lib/libSystem.tbd
Undefined symbols for architecture i386:
  "_OSAtomicCompareAndSwapPtr", referenced from:
  ___darwintrace_setup in darwintrace.o
  "__DefaultRuneLocale", referenced from:
  _check_interpreter in proc.o
  "___error", referenced from:
      __dt_access in access.o
      __dt_close in close.o
  ___darwintrace_setup_tls in darwintrace.o
  ___darwintrace_setup in darwintrace.o
  __dt_dup2 in dup2.o
  __dt_mkdir in mkdir.o
  __dt_open in open.o
  ...
  "___getdirentries64", referenced from:
      __interpose___getdirentries64 in readdir.o
  "___maskrune", referenced from:
      _check_interpreter in proc.o
  "___snprintf_chk", referenced from:
      ___darwintrace_sandbox_check in darwintrace.o
      ___darwintrace_log_op in darwintrace.o
  "___stack_chk_fail", referenced from:
      ___darwintrace_setup in darwintrace.o
      ___darwintrace_is_in_sandbox in darwintrace.o
      ___darwintrace_sandbox_check in darwintrace.o
      ___darwintrace_log_op in darwintrace.o
      _check_interpreter in proc.o
      __dt_getdirentries64 in readdir.o
     __dt_getdirentries in readdir.o
  ...

  "_unlink", referenced from:
      __interpose_unlink in unlink.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [darwintrace.dylib] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1

如何从Xcode中删除i386体系结构?如何解决此错误?

2 个答案:

答案 0 :(得分:0)

所以问题在于,苹果已经取消了使用xcode10在macOS上编译32位程序的功能

来源:https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes

答案 1 :(得分:0)

使用xcode 9.4或9.4.1,这是支持32位构建并在Mojave上有效的最新版本。