如何获取对Xcode“clang”的调用编译时错误? [英] How to get invocation for Xcode "clang" compile-time error?

查看:644
本文介绍了如何获取对Xcode“clang”的调用编译时错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode中得到包含此消息的编译时错误

I get a compile-time error in Xcode that includes this message


clang:error:linker command failed with exit code 1使用-v查看调用)

clang: error: linker command failed with exit code 1 (use -v to see invocation)

这个 -v -line选项。我之前遇到过这个消息,对于我可以做些什么以及为什么它包括,如果我不能做任何事情,总是失去。

This -v is evidently a command-line option. I've run into this message before and have always been at a loss as to what I can do about it and why it's included if I can't do anything about it.


推荐答案

您可以添加 -v 添加到项目设置中的其他链接器标志字段。在测试项目中这样做会产生完整的链接器调用:

You can add the -v to the "Other Linker Flags" field in the project settings. Doing so in a test project here yields the complete linker invocation:

 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
 -demangle
 -dynamic
 -arch x86_64
 -macosx_version_min 10.8.0
 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk
 -o /Users/carl/Library/Developer/Xcode/DerivedData/example-ewesimyvcwmjptdwzbkqoasrcppe/Build/Products/Debug/example
 -L/Users/carl/Library/Developer/Xcode/DerivedData/example-ewesimyvcwmjptdwzbkqoasrcppe/Build/Products/Debug
 -filelist /Users/carl/Library/Developer/Xcode/DerivedData/example-ewesimyvcwmjptdwzbkqoasrcppe/Build/Intermediates/example.build/Debug/example.build/Objects-normal/x86_64/example.LinkFileList
 -dependency_info /Users/carl/Library/Developer/Xcode/DerivedData/example-ewesimyvcwmjptdwzbkqoasrcppe/Build/Intermediates/example.build/Debug/example.build/Objects-normal/x86_64/example_dependency_info.dat
 -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.0/lib/darwin/libclang_rt.osx.a
 -F/Users/carl/Library/Developer/Xcode/DerivedData/example-ewesimyvcwmjptdwzbkqoasrcppe/Build/Products/Debug

这篇关于如何获取对Xcode“clang”的调用编译时错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆