2012-12-04 31 views
0

我遇到了一個鏈接器錯誤,我似乎無法解決或找到問題原因。我在我的iOS項目中添加了一個Category,名爲ParentViewController+CoreData。我沒有在.h.m文件中向這個類別添加任何內容,但是如果我將它導入到另一個文件中,我會得到35個鏈接器錯誤。 ParentViewController是我想要爲其分類的代碼中的視圖控制器。如果我從標準視圖控制器中創建一個類別,我沒有任何問題。我從過去沒有問題的自定義視圖控制器做出了類別,我在這裏找不到問題。添加了類別並獲得了35個鏈接器錯誤

下面是鏈接器錯誤:編譯器

Ld /Users/Heather/Library/Developer/Xcode/DerivedData/Lodge-dffwatcyrvyekkdhbejusjleqkjn/Build/Products/Debug-iphonesimulator/Lodge.app/Lodge normal i386 
    cd /Users/Heather/Documents/lodge 
    setenv IPHONEOS_DEPLOYMENT_TARGET 5.1 
    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/iPhoneSimulator6.0.sdk -L/Users/Heather/Library/Developer/Xcode/DerivedData/Lodge-dffwatcyrvyekkdhbejusjleqkjn/Build/Products/Debug-iphonesimulator -L/Users/Heather/Documents/lodge -F/Users/Heather/Library/Developer/Xcode/DerivedData/Lodge-dffwatcyrvyekkdhbejusjleqkjn/Build/Products/Debug-iphonesimulator -filelist /Users/Heather/Library/Developer/Xcode/DerivedData/Lodge-dffwatcyrvyekkdhbejusjleqkjn/Build/Intermediates/Lodge.build/Debug-iphonesimulator/Lodge.build/Objects-normal/i386/Lodge.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -ObjC -all_load -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -framework CoreData -lz -framework CoreGraphics -framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework QuickLook -framework CoreLocation -framework MessageUI -framework ImageIO -lxml2 -framework CoreText -framework Security -framework QuartzCore -framework UIKit -framework Foundation -lFlurryAnalytics -o /Users/Heather/Library/Developer/Xcode/DerivedData/Lodge-dffwatcyrvyekkdhbejusjleqkjn/Build/Products/Debug-iphonesimulator/Lodge.app/Lodge 

Undefined symbols for architecture i386: 
    "_kGTMHTTPFetcherErrorChallengeKey", referenced from: 
     -[GTMHTTPFetcher connection:didReceiveAuthenticationChallenge:] in GTMHTTPFetcher.o 
    "_kGTMHTTPFetcherErrorDomain", referenced from: 
     -[GTMHTTPFetcher failToBeginFetchWithError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher backgroundFetchExpired] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connection:didReceiveAuthenticationChallenge:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher uploadNextChunkWithOffset:fetcherProperties:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPFetcher failToBeginFetchWithError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher backgroundFetchExpired] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connection:didReceiveAuthenticationChallenge:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher uploadNextChunkWithOffset:fetcherProperties:] in GTMHTTPUploadFetcher.o 
    "_kGTMHTTPFetcherRetryDelayStartedNotification", referenced from: 
     -[GTMHTTPFetcher primeRetryTimerWithNewTimeInterval:] in GTMHTTPFetcher.o 
    "_kGTMHTTPFetcherRetryDelayStoppedNotification", referenced from: 
     -[GTMHTTPFetcher destroyRetryTimer] in GTMHTTPFetcher.o 
    "_kGTMHTTPFetcherStartedNotification", referenced from: 
     -[GTMHTTPFetcher beginFetchMayDelay:mayAuthorize:] in GTMHTTPFetcher.o 
    "_kGTMHTTPFetcherStatusDataKey", referenced from: 
     -[GTMHTTPFetcher connectionDidFinishLoading:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher shouldRetryNowForStatus:error:] in GTMHTTPFetcher.o 
    "_kGTMHTTPFetcherStatusDomain", referenced from: 
     -[GTMHTTPFetcher connection:didReceiveData:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connectionDidFinishLoading:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher isRetryError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher shouldRetryNowForStatus:error:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher connectionDidFinishLoading:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:finishedWithData:error:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:willRetry:forError:] in GTMHTTPUploadFetcher.o 
     ... 
     -[GTMHTTPFetcher connection:didReceiveData:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connectionDidFinishLoading:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher isRetryError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher shouldRetryNowForStatus:error:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher connectionDidFinishLoading:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:finishedWithData:error:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:willRetry:forError:] in GTMHTTPUploadFetcher.o 
     ... 
     -[GTMHTTPFetcher connection:didReceiveData:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connectionDidFinishLoading:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher isRetryError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher shouldRetryNowForStatus:error:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher connectionDidFinishLoading:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:finishedWithData:error:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:willRetry:forError:] in GTMHTTPUploadFetcher.o 
     ... 
     -[GTMHTTPFetcher connection:didReceiveData:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher connectionDidFinishLoading:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher isRetryError:] in GTMHTTPFetcher.o 
     -[GTMHTTPFetcher shouldRetryNowForStatus:error:] in GTMHTTPFetcher.o 
     -[GTMHTTPUploadFetcher connectionDidFinishLoading:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:finishedWithData:error:] in GTMHTTPUploadFetcher.o 
     -[GTMHTTPUploadFetcher chunkFetcher:willRetry:forError:] in GTMHTTPUploadFetcher.o 
     ... 
    "_kGTMHTTPFetcherStoppedNotification", referenced from: 
     -[GTMHTTPFetcher sendStopNotificationIfNeeded] in GTMHTTPFetcher.o 
    "_kGTMOAuth2AccessTokenRefreshed", referenced from: 
     -[GTMOAuth2Authentication auth:finishedRefreshWithFetcher:error:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2ErrorDomain", referenced from: 
     -[GTMOAuth2Authentication authorizeRequestImmediateArgs:] in GTMOAuth2Authentication.o 
     -[GTMOAuth2SignIn windowWasClosed] in GTMOAuth2SignIn.o 
     -[GTMOAuth2SignIn handleCallbackReached] in GTMOAuth2SignIn.o 
     -[GTMOAuth2Authentication authorizeRequestImmediateArgs:] in GTMOAuth2Authentication.o 
     -[GTMOAuth2SignIn windowWasClosed] in GTMOAuth2SignIn.o 
     -[GTMOAuth2SignIn handleCallbackReached] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2ErrorJSONKey", referenced from: 
     -[GTMOAuth2Authentication tokenFetcher:finishedWithData:error:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2ErrorMessageKey", referenced from: 
     -[GTMOAuth2SignIn handleCallbackReached] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2ErrorRequestKey", referenced from: 
     -[GTMOAuth2Authentication authorizeRequestImmediateArgs:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchStarted", referenced from: 
     -[GTMOAuth2Authentication notifyFetchIsRunning:fetcher:type:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchStopped", referenced from: 
     -[GTMOAuth2Authentication notifyFetchIsRunning:fetcher:type:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchTypeAssertion", referenced from: 
     -[GTMOAuth2Authentication beginTokenFetchWithDelegate:didFinishSelector:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchTypeKey", referenced from: 
     -[GTMOAuth2Authentication notifyFetchIsRunning:fetcher:type:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchTypeRefresh", referenced from: 
     -[GTMOAuth2Authentication beginTokenFetchWithDelegate:didFinishSelector:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchTypeToken", referenced from: 
     -[GTMOAuth2Authentication beginTokenFetchWithDelegate:didFinishSelector:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2FetchTypeUserInfo", referenced from: 
     -[GTMOAuth2SignIn fetchGoogleUserInfo] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2FetcherKey", referenced from: 
     -[GTMOAuth2Authentication notifyFetchIsRunning:fetcher:type:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2KeychainErrorDomain", referenced from: 
     -[GTMOAuth2Keychain passwordForService:account:error:] in GTMOAuth2ViewControllerTouch.o 
     -[GTMOAuth2Keychain removePasswordForService:account:error:] in GTMOAuth2ViewControllerTouch.o 
     -[GTMOAuth2Keychain setPassword:forService:accessibility:account:error:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2NetworkFound", referenced from: 
     -[GTMOAuth2SignIn reachabilityTarget:changedFlags:] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2NetworkLost", referenced from: 
     -[GTMOAuth2SignIn reachabilityTimerFired:] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2RefreshTokenChanged", referenced from: 
     -[GTMOAuth2Authentication setKeysForResponseDictionary:] in GTMOAuth2Authentication.o 
    "_kGTMOAuth2ServiceProviderGoogle", referenced from: 
     +[GTMOAuth2SignIn standardGoogleAuthenticationForScope:clientID:clientSecret:] in GTMOAuth2SignIn.o 
     -[GTMOAuth2SignIn auth:finishedWithFetcher:error:] in GTMOAuth2SignIn.o 
     +[GTMOAuth2SignIn revokeTokenForGoogleAuthentication:] in GTMOAuth2SignIn.o 
     +[GTMOAuth2ViewControllerTouch authForGoogleFromKeychainForName:clientID:clientSecret:] in GTMOAuth2ViewControllerTouch.o 
     +[GTMOAuth2SignIn standardGoogleAuthenticationForScope:clientID:clientSecret:] in GTMOAuth2SignIn.o 
     -[GTMOAuth2SignIn auth:finishedWithFetcher:error:] in GTMOAuth2SignIn.o 
     +[GTMOAuth2SignIn revokeTokenForGoogleAuthentication:] in GTMOAuth2SignIn.o 
     +[GTMOAuth2ViewControllerTouch authForGoogleFromKeychainForName:clientID:clientSecret:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2UserSignedIn", referenced from: 
     -[GTMOAuth2SignIn handleCallbackReached] in GTMOAuth2SignIn.o 
    "_kGTMOAuth2WebViewCancelled", referenced from: 
     -[GTMOAuth2ViewControllerTouch viewWillDisappear:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewFailed", referenced from: 
     -[GTMOAuth2ViewControllerTouch webView:didFailLoadWithError:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewFinished", referenced from: 
     -[GTMOAuth2ViewControllerTouch webViewDidFinishLoad:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewKey", referenced from: 
     -[GTMOAuth2ViewControllerTouch notifyWithName:webView:kind:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewStartedLoading", referenced from: 
     -[GTMOAuth2ViewControllerTouch notifyWithName:webView:kind:] in GTMOAuth2ViewControllerTouch.o 
     -[GTMOAuth2ViewControllerTouch webViewDidStartLoad:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewStopKindKey", referenced from: 
     -[GTMOAuth2ViewControllerTouch notifyWithName:webView:kind:] in GTMOAuth2ViewControllerTouch.o 
    "_kGTMOAuth2WebViewStoppedLoading", referenced from: 
     -[GTMOAuth2ViewControllerTouch viewWillDisappear:] in GTMOAuth2ViewControllerTouch.o 
     -[GTMOAuth2ViewControllerTouch webViewDidFinishLoad:] in GTMOAuth2ViewControllerTouch.o 
     -[GTMOAuth2ViewControllerTouch webView:didFailLoadWithError:] in GTMOAuth2ViewControllerTouch.o 
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 
+0

分享你.m和.h文件 –

回答

0

正是從這一目標文件無法讀取該文件明確/獲取。如果您的類別文件已添加到應用程序目標中,請檢查目標。

這類問題我面對很多,我希望這會解決你的問題。

+0

該文件正在被添加到應用程序目標中 - 我檢查了Target-> Build Phases-> Compile Sources,並且ParentViewController + CoreData.m在那裏。 – coder

+0

你可以給我發郵件給你嗎?但我只能在12小時後回覆,因爲它的夜晚在這裏..睡覺:) –

0

該項目的目標是編譯但不鏈接到源的GTM的OAuth 2個控制器,http://code.google.com/p/gtm-oauth2/

+0

它工作正常,直到我試圖添加類別,它甚至不使用這些文件...任何想法,爲什麼它會導致這些錯誤? – coder

2

我有同樣的問題。我的問題與Prefix.pch文件有關,我在那裏創建了一個無限循環的導入。我反而刪除了使用Google Drive API的數據源,並且只在使用它的特定文件中導入。菜鳥的錯誤,是一個痛苦的屁股搞清楚,但要確保你也沒有一個無盡的循環!

+0

你剛剛救了我:-)非常感謝! –