我對此很新,但我會盡量提供儘可能詳細的信息。我最初嘗試提供屏幕截圖,但是如果沒有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