我添加了所有相關的框架,並導入了所有相關的文件。事實上,如果我刪除導入,它會給我所有的方法找不到錯誤。任何想法如何解決這一問題?Apple mach-o鏈接(Id)錯誤
Ld /Users/Andrew/Library/Developer/Xcode/DerivedData/Journal-acrxfhgfvgofuyczzlzmnzunciov/Build/Products/Debug-iphonesimulator/Journal.app/Journal normal i386
cd "/Users/Andrew/Dropbox/Developer/Dear Me/Version 1.0/XCode/Journal/Journal"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk -L/Users/Andrew/Library/Developer/Xcode/DerivedData/Journal-acrxfhgfvgofuyczzlzmnzunciov/Build/Products/Debug-iphonesimulator -F/Users/Andrew/Library/Developer/Xcode/DerivedData/Journal-acrxfhgfvgofuyczzlzmnzunciov/Build/Products/Debug-iphonesimulator -filelist /Users/Andrew/Library/Developer/Xcode/DerivedData/Journal-acrxfhgfvgofuyczzlzmnzunciov/Build/Intermediates/Journal.build/Debug-iphonesimulator/Journal.build/Objects-normal/i386/Journal.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/Andrew/Library/Developer/Xcode/DerivedData/Journal-acrxfhgfvgofuyczzlzmnzunciov/Build/Products/Debug-iphonesimulator/Journal.app/Journal
Undefined symbols for architecture i386:
"_rectForRectWithInset", referenced from:
-[JButton drawRect:] in JButton.o
"_createRoundedRectForRect", referenced from:
-[JButton drawRect:] in JButton.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
編輯:
從這些代碼:
CGRect borderRect = rectForRectWithInset(self.bounds, 0.5);
CGMutablePathRef borderPath = createRoundedRectForRect(borderRect, 4);
他們引用了一類在這些方法中它可以在另一個項目中,我有,用相同的進口,是相同的。引用的方法,相同的導入框架。
你能向我們展示產生這些錯誤的兩行代碼嗎?另外,你添加了什麼框架? – 2012-03-11 15:04:51
用該信息編輯。 – Andrew 2012-03-11 17:01:27
我無法在Apple框架中找到這些方法。你知道他們應該在什麼框架嗎?在QuartzCore/CoreGraphics中有相當的(如下面答案的評論中所提到的),所以我建議使用這些。 – 2012-03-12 12:16:19