【发布时间】:2014-10-16 22:21:30
【问题描述】:
我对此很陌生,但我会尽量提供尽可能详细的信息。我最初尝试提供屏幕截图,但如果没有 10 名声望,我将无法这样做,因此我将在底部将错误消息复制并粘贴为文本。
我正在研究哈佛 CS50 问题集 1。作为其中的一部分,您应该使用为课程作业提供的库。它有两个文件:cs50.h 和 cs50.c
我已经下载了这些文件,最初我遇到了一个错误,我发现这是因为它是一个 32 位库并且我正在运行 64 位。我通过转到 Project > Build Phases > Link Binary with Libraries 更改了引用库的位置,因为我在网上发现的内容表明,如果我在这里处理它,Xcode 将负责确保正确的架构等(32 位与 64 位相比)。
现在我收到黄色错误,说明当我尝试构建时它正在传递这些文件,因为它是意外的文件类型。
我找到了使用文件检查器查看类型的建议,然后我轮流浏览了各种可用的 C 文件类型,看看它是否能修复任何问题,但我没有运气。
我还发现了另一个关于此的对话,表明将架构类型更新为通用选项会有所帮助,但这并没有改变任何东西。
此时,我无法通过 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)
【问题讨论】:
-
投赞成票。再加上一个赞成票,您应该有 10 名声望并且能够上传屏幕截图。我想截图会让你更容易帮助到你。