开发者

XCode Cocoa Console Application Linking Error

I made a new project in XCode (console application). Then I added a new Objective-C class and compiled it. However, it wouldn't build. Here are the errors I am seeing:

Undefined symbols:
  "_objc_msgSendSuper", referenced from:
      -[Terminal i开发者_C百科nit] in Terminal.o
      -[Terminal dealloc] in Terminal.o
  ".objc_class_name_NSObject", referenced from:
      .objc_class_name_Terminal in Terminal.o
ld: symbol(s) not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Terminal is the name of the new class that I added. Thanks for any help!


Sounds like you didn't link with the Cocoa framework (C console programs don't do it by default). Right-click your project, go to "Add", and select "Existing Frameworks..." Find Cocoa.framework in there and build again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜