我对此很新,但我会尽量提供尽可能详细的信息。我最初尝试提供屏幕截图,但是如果没有10个声望,我不能这样做,所以我将复制并粘贴错误消息作为底部的文本。如何在Xcode 6中将库添加到我的C项目中
我在哈佛大学CS50问题集1上工作。作为其中的一部分,您应该使用为课程提供的库。它有两个文件:cs50.h和cs50.c
我已经下载了这些文件,最初我收到一个错误,我发现这是因为它是一个32位库,我正在运行64位。我通过转到Project> Build Phases> Link Binary with Libraries,改变了我在引用库的位置,因为我在网上发现的内容表明,如果我在这里处理它,Xcode将负责确保正确的体系结构等等(32位与64位)。
现在我收到了黄色错误,指出它在我尝试构建时传递这些文件,因为它是一个意外的文件类型。
我发现了一个建议,使用文件检查器来查看类型,我旋转了各种可用的C文件类型,看看它是否会解决任何问题,我没有运气。
我还发现另一个对话,表示更新体系结构类型为Universal选项会有所帮助,但这并没有改变任何内容。
此时,我无法通过Google搜索找到与我的问题相关的任何内容。
我也意识到,由于我的新颖性,我刚刚做了一些非常愚蠢的事情,但我觉得我花了很多时间来解决这个问题。我感谢任何帮助。
warning: skipping file '/Users/matthewcanova/Documents/include/cs50.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
warning: skipping file '/Users/matthewcanova/Documents/include/cs50.c' (unexpected file type 'sourcecode.c.c' in Frameworks & Libraries build phase)
Warning: skipping file '/Users/matthewcanova/Documents/include/cs50.h' (unexpected file type 'sourcecode.c.h' in Frameworks & Libraries build phase)
Warning: skipping file '/Users/matthewcanova/Documents/include/cs50.c' (unexpected file type 'sourcecode.c.c' in Frameworks & Libraries build phase)
Ld /Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1- hkvfcrlbsfojiafrcnafkxgoannu/Build/Products/Debug/Problem\ Set\ 1 normal x86_64
cd "/Users/matthewcanova/Documents/Problem Set 1"
export MACOSX_DEPLOYMENT_TARGET=10.9
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -L/Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1-hkvfcrlbsfojiafrcnafkxgoannu/Build/Products/Debug -F/Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1-hkvfcrlbsfojiafrcnafkxgoannu/Build/Products/Debug -filelist /Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1-hkvfcrlbsfojiafrcnafkxgoannu/Build/Intermediates/Problem\ Set\ 1.build/Debug/Problem\ Set\ 1.build/Objects-normal/x86_64/Problem\ Set\ 1.LinkFileList -mmacosx-version-min=10.9 -Xlinker -dependency_info -Xlinker /Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1-hkvfcrlbsfojiafrcnafkxgoannu/Build/Intermediates/Problem\ Set\ 1.build/Debug/Problem\ Set\ 1.build/Objects-normal/x86_64/Problem\ Set\ 1_dependency_info.dat -o /Users/matthewcanova/Library/Developer/Xcode/DerivedData/Problem_Set_1-hkvfcrlbsfojiafrcnafkxgoannu/Build/Products/Debug/Problem\ Set\ 1
Undefined symbols for architecture x86_64:
"_GetInt", referenced from:
_getPyramidHeight in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
采取upvote。与另一个upvote你应该有10 reputiation并能够上传屏幕截图。我猜测截图会让你更容易帮助你。 – nburk 2014-10-16 22:34:25