Xcode 运行叮当声++;编译后的文件引发;dyld:mach-o,但专为模拟器(非macOS)而建”;安装React Native后

Xcode 运行叮当声++;编译后的文件引发;dyld:mach-o,但专为模拟器(非macOS)而建”;安装React Native后,xcode,clang++,Xcode,Clang++,在我安装React Native之后。 每当通过“叮当”创建文件时,我都无法执行该文件。 我总是在尝试执行时收到此消息 dyld: mach-o, but built for simulator (not macOS) 我发现我的默认编译选项clang被改为“ios模拟器” 如何更改此默认选项 $ clang++ --std=c++17 --verbose test_move.cpp Apple LLVM version 10.0.1 (clang-1001.0.46.4) Target: x

在我安装React Native之后。 每当通过“叮当”创建文件时,我都无法执行该文件。 我总是在尝试执行时收到此消息

dyld: mach-o, but built for simulator (not macOS)
我发现我的默认编译选项clang被改为“ios模拟器”

如何更改此默认选项

$ clang++ --std=c++17 --verbose test_move.cpp
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-ios9.0.0-simulator -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -Werror=implicit-function-declaration -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name test_move.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -faligned-alloc-unavailable -target-sdk-version=12.2 -target-cpu core2 -dwarf-column-info -debugger-tuning=lldb -target-linker-version 450.3 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -stdlib=libc++ -Wno-atomic-implicit-seq-cst -Wno-framework-include-private-from-public -Wno-atimport-in-framework-header -Wno-quoted-include-in-framework-header -Wno-error --std=c++17 -fdeprecated-macro -fdebug-compilation-dir /Users/user/workspace/examples -ferror-limit 19 -fmessage-length 149 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=ios-9.0.0 -fcxx-exceptions -fexceptions -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -o /var/folders/9k/c6qvlvt10wg3g5vyzf009lxw0000gn/T/test_move-3416bc.o -x c++ test_move.cpp
clang -cc1 version 10.0.1 (clang-1001.0.46.4) default target x86_64-apple-darwin18.5.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/c++/v1"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/Library/Frameworks"
include "..." search starts here:
include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks (framework directory)
End of search list.
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -ios_simulator_version_min 9.0.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -o a.out /var/folders/9k/c6qvlvt10wg3g5vyzf009lxw0000gn/T/test_move-3416bc.o -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang_rt.ios.a
$
$
$ ./a.out
dyld: mach-o, but built for simulator (not macOS)
Abort trap: 6
$clang++--std=c++17--verbose test\u move.cpp
苹果LLVM版本10.0.1(clang-1001.0.46.4)
目标:x86_64-apple-darwin18.5.0
线程模型:posix
InstalledDir:/Applications/Xcode.app/Contents/Developer/Toolchains/xcodefault.xctoolchain/usr/bin
“/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/bin/clang”-cc1-triple x86_64-apple-ios9.0.0-simulator-Wdeprecated objc isa用法-Werror=已弃用的objc isa用法-Werror=隐式函数声明-emit obj-mrelax all-disable free-disable llvm验证器-discard值名-main file name test_move.cpp-mrelocation model pic-pic level 2-mthread model posix-mdiable fp elim-fno严格返回-masm verbose-munwind tables-falligned alloc unavailable-target sdk version=12.2-target cpu core2-dwarf column info-debugger tuning=lldb-target linker version 450.3-v-resource dir/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xtoolschain/usr/lib/clang/10.0.1-isysroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk-stdlib=libc++-Wno原子隐式seq cst-Wno framework include private from public-Wno atimport in framework header-Wno quoted include in framework-Wno error-std=c++17-fdeprecated宏-fdebug编译dir/用户/用户/工作区/示例-ferror limit 19-fmessage length 149-stack protector 1-fblocks-fencode扩展块签名-使用atexit注册全局DTOR-fobjc runtime=ios-9.0.0-fcxx异常-FeExceptions-fmax type align=16-FDDiagnostics show选项-fcolor diagnostics-o/Va/文件夹/9K/C6QVLVT10WG3G5VYZF9009LXW000 GN/TestSoMMOVE-34 16BC O-XC++ C++ TestSoviv.CPP
clang-cc1版本10.0.1(clang-1001.0.46.4)默认目标x86_64-apple-darwin18.5.0
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include/c++/v1”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/local/include”
忽略不存在的目录“/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/Library/Frameworks”
包括“…”搜索从这里开始:
包括搜索从这里开始:
/Applications/Xcode.app/Contents/Developer/Toolchains/xcodefault.xctoolchain/usr/include/c++/v1
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.1/include
/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk/System/Library/Frameworks(框架目录)
搜索列表结束。
“/Applications/Xcode.app/Contents/Developer/toolschains/xcodefault.xctoolschain/usr/bin/ld”-demangle-lto_库/应用程序/Xcode.app/Contents/Developer/Toolchains/Xcode default.xctoolchain/usr/lib/libLTO.dylib-无重复数据消除-动态-arch x86_64-ios_模拟器版本\u min 9.0.0-syslibroot/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator 12.2.sdk-o a.out/var/folders/9k/c6qvlvt10wg3g5vyzf009lxw0000gn/T/test_move-3416bc.o-lc++-lSystem/Applications/Xcode.app/Contents/Developer/toolschains/XcodeDefault.xtoolchain/usr/lib/clang/10.0.1/lib/darwin/libclang\u rt.ios.a
$
$
美元/年
dyld:mach-o,但专为模拟器(非macOS)而建
中止陷阱:6
相关: