我对此并不陌生,但是我将尝试提供尽可能详细的信息。我最初尝试提供屏幕截图,但是如果没有10个信誉,我将无法做到这一点,因此我将在底部复制并粘贴错误消息作为文本。
我正在研究哈佛CS50问题集1。作为其中的一部分,您应该使用为课程提供的库。它有两个文件:cs50.h和cs50.c
我已经下载了这些文件,最初发现一个错误,我发现这是因为它是32位库并且我正在运行64位。通过转到项目>构建阶段>与库链接二进制文件,我更改了引用库的位置,因为我在网上发现,如果我在这里处理它,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)
这些是源代码文件,需要使用您构建的应用程序进行编译。用您所说的话,您似乎正在尝试链接那些文件,就好像它们已经被编译一样。
您应该从“链接二进制文件和库”阶段中删除它们,并将“ .c”文件添加到项目的“编译源”阶段(只有“ .c”文件,因为只有该文件实际上包含需要“ .h”文件是一个旨在通知其他人该代码提供的功能的接口的文件)
这基本上是链接程序在警告中告诉您的内容:在构建的此阶段找不到源代码文件是很困惑的
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句