Search code examples
objective-cxcodegcdasyncsocket

Issue with GCDAsyncSocket in Mountain Lion


I am having an issue using the GCDAsyncSocket class in my Mac (Objective-C) application. Here is the error I get:

Apple Mach-O Linker (Id) Error

Ld "/Users/matthewdahl/Library/Developer/Xcode/DerivedData/Server_Tester-fkkcdricfunsmwcdnerorqdtqetc/
  Build/Products/Debug/Server Tester.app/Contents/MacOS/Server Tester" normal x86_64
    cd "/Volumes/Data/Programming/ControlTouch/P12127/Server Tester"
    setenv MACOSX_DEPLOYMENT_TARGET 10.8

    /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.8.sdk -L/Users/matthewdahl/Library/Developer/Xcode/DerivedData/Server_Tester-
  fkkcdricfunsmwcdnerorqdtqetc/Build/Products/Debug -L/Applications/Xcode.app/Contents/Developer/
  Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/lib/system -F/Users/matthewdahl/Library/
  Developer/Xcode/DerivedData/Server_Tester-fkkcdricfunsmwcdnerorqdtqetc/Build/Products/Debug -filelist 
  "/Users/matthewdahl/Library/Developer/Xcode/DerivedData/Server_Tester-fkkcdricfunsmwcdnerorqdtqetc/
  Build/Intermediates/Server Tester.build/Debug/Server Tester.build/Objects-normal/x86_64/Server 
  Tester.LinkFileList" -mmacosx-version-min=10.8 -fobjc-arc -fobjc-link-runtime -framework Security -
  framework Cocoa -o "/Users/matthewdahl/Library/Developer/Xcode/DerivedData/Server_Tester-
  fkkcdricfunsmwcdnerorqdtqetc/Build/Products/Debug/Server Tester.app/Contents/MacOS/Server Tester"

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_GCDAsyncSocket", referenced from:
      objc-class-ref in ServerTesterAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am really having trouble comprehending the issue here. I have tried removing and re-adding the GCDAsyncSocket.h and .m files. I have verified that all imports are importing .h files and not .m files. I have cleaned the project, and have even tried making a new project from scratch. Any insight into what is possibly causing this would be great. (Note: I did just upgrade to Mountain Lion - not sure if it could be the culprit or not)


Solution

  • Go to Project > Targets > Build Phases > Compile Sources. Are all of your .m files in the list?