在xcode中导入外部库 - C ++

时间:2010-12-15 01:56:57

标签: c++ xcode

我很安静的编码新手,所以答案可能很简单。 我正在Xcode上开始一个新的C ++项目,我想从另一个任务中导入一个外部库:http://www.stanford.edu/class/cs106b/assignments/assn-0-narcissism-mac.zip

我想在新项目中使用libcs​​106.a库。当我手动将文件导入我的新项目,并开始#include库(如simpio.h)时,我得到了113个错误的长列表:

Ld ./assn-0-narcissism.app/Contents/MacOS/assn-0-narcissism normal i386
cd "/Users/Dropbox/perso/programming/cs106b/assignments/assn-0-narcissism-mac 2"
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L. -Lcs106 "-L/Users/Dropbox/perso/programming/cs106b/assignments/assn-0-narcissism-mac 2/cs106" -F. -filelist "/Users/Dropbox/perso/programming/cs106b/assignments/assn-0-narcissism-mac 2/build/narcissism.build/Debug/assn-0-narcissism.build/Objects-normal/i386/assn-0-narcissism.LinkFileList" -mmacosx-version-min=10.5 -lcs106 -o ./assn-0-narcissism.app/Contents/MacOS/assn-0-narcissism

Undefined symbols:
  ".objc_class_name_NSString", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSString in libcs106.a(mainwrapper.o)
      literal-pointer@__OBJC@__cls_refs@NSString in libcs106.a(ConsoleTextView.o)
  "_FindWindow", referenced from:
      MouseButtonIsDown()     in libcs106.a(graphics.o)
      MouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in libcs106.a(graphics.o)
  "_ScreenRes", referenced from:
      GetFullScreenWidth()     in libcs106.a(graphics.o)
      GetFullScreenHeight()     in libcs106.a(graphics.o)
      GetXResolution()     in libcs106.a(graphics.o)
      GetYResolution()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
  ".objc_class_name_NSScreen", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSScreen in libcs106.a(ConsoleTextView.o)
  "_DisposeMovie", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  "_FrameArc", referenced from:
      DisplayArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
  ".objc_class_name_NSThread", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSThread in libcs106.a(mainwrapper.o)
  "_DrawText", referenced from:
      DisplayText(double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_OffsetRect", referenced from:
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_CopyCStringToPascal", referenced from:
      GetFontNumber(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_GetWindowEventTarget", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_MPEnterCriticalRegion", referenced from:
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      BeginDrawing()     in libcs106.a(graphics.o)
  "_CFBundleCopyBundleURL", referenced from:
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
  "_SetWindowTitleWithCFString", referenced from:
      UpdateTitle(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_CloseMovieFile", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  ".objc_class_name_NSMenu", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSMenu in libcs106.a(mainwrapper.o)
  "_InstallEventLoopTimer", referenced from:
      SetWindowTitle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
  "_CFURLCreateCopyDeletingLastPathComponent", referenced from:
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
  "_NSApp", referenced from:
      _NSApp$non_lazy_ptr in libcs106.a(mainwrapper.o)
      _NSApp$non_lazy_ptr in libcs106.a(ConsoleTextView.o)
     (maybe you meant: _NSApp$non_lazy_ptr)
  "_EnterMovies", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  "_GetMouse", referenced from:
      MouseButtonIsDown()     in libcs106.a(graphics.o)
      GetMouseY()    in libcs106.a(graphics.o)
      GetMouseX()    in libcs106.a(graphics.o)
  "_InstallEventHandler", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_QDGetPictureBounds", referenced from:
      GetPictureHeight(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      GetPictureWidth(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_NewRgn", referenced from:
      EndFilledRegion()     in libcs106.a(graphics.o)
  ".objc_class_name_NSWindow", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSWindow in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSApplication", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSApplication in libcs106.a(mainwrapper.o)
  "_GetPort", referenced from:
      GetMouseY()    in libcs106.a(graphics.o)
      GetMouseX()    in libcs106.a(graphics.o)
  "_ShowWindow", referenced from:
      ShowWindows(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_GetGWorldPixMap", referenced from:
      BeginDrawing()     in libcs106.a(graphics.o)
      EndDrawing()     in libcs106.a(graphics.o)
  "_GetPortBitMapForCopyBits", referenced from:
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_CFURLGetFileSystemRepresentation", referenced from:
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
  "_NewGWorld", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_objc_msgSend_stret", referenced from:
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView createConsoleInWindow] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView createConsoleInWindow] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
  "_CFBundleGetInfoDictionary", referenced from:
      CreateMenus()     in libcs106.a(mainwrapper.o)
  "_objc_msgSend", referenced from:
      +[Glue applicationDidFinishLaunching:] in libcs106.a(mainwrapper.o)
      +[Glue studentMain] in libcs106.a(mainwrapper.o)
      +[Glue studentMain] in libcs106.a(mainwrapper.o)
      +[Glue studentMain] in libcs106.a(mainwrapper.o)
      +[Glue studentMain] in libcs106.a(mainwrapper.o)
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      +[Glue showAbout:] in libcs106.a(mainwrapper.o)
      CocoaConsoleResize(int, int, int, int)in libcs106.a(mainwrapper.o)
      CocoaConsoleResize(int, int, int, int)in libcs106.a(mainwrapper.o)
      TerminateApp()     in libcs106.a(mainwrapper.o)
      SetConsoleSize(int, int, int, bool)in libcs106.a(mainwrapper.o)
      patched_read(void*, char*, int)in libcs106.a(mainwrapper.o)
      patched_read(void*, char*, int)in libcs106.a(mainwrapper.o)
      ConnectConsoleToStdio(ConsoleTextView*)      in libcs106.a(mainwrapper.o)
      CreateMenuWithItems(NSString*, menuitem*, int)in libcs106.a(mainwrapper.o)
      CreateMenuWithItems(NSString*, menuitem*, int)in libcs106.a(mainwrapper.o)
      CreateMenuWithItems(NSString*, menuitem*, int)in libcs106.a(mainwrapper.o)
      CreateMenus()     in libcs106.a(mainwrapper.o)
      CreateMenus()     in libcs106.a(mainwrapper.o)
      CustomApplicationMain(int, char**)in libcs106.a(mainwrapper.o)
      CustomApplicationMain(int, char**)in libcs106.a(mainwrapper.o)
      CustomApplicationMain(int, char**)in libcs106.a(mainwrapper.o)
      CustomApplicationMain(int, char**)in libcs106.a(mainwrapper.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView createConsoleInWindow] in libcs106.a(ConsoleTextView.o)
      +[ConsoleTextView createConsoleInWindow] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setPointSize:numRows:numCols:center:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView registerForNotifications] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setInput:output:error:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView gotDataOnOut:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView gotDataOnOut:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView gotDataOnOut:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView gotDataOnOut:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView appendString:withAttributes:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView rangeForUserTextChange] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView rangeForUserTextChange] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView rangeForUserTextChange] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView commit] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView commit] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView studentProgramCompleted] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView studentProgramCompleted] in libcs106.a(ConsoleTextView.o)
  "_LockPixels", referenced from:
      BeginDrawing()     in libcs106.a(graphics.o)
  "_GetFontInfo", referenced from:
      SetTextBB(Rect*, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      GetFontHeight()     in libcs106.a(graphics.o)
      GetFontDescent()     in libcs106.a(graphics.o)
      GetFontAscent()     in libcs106.a(graphics.o)
  "_LineTo", referenced from:
      RenderArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
      DisplayLine(double, double, double, double)in libcs106.a(graphics.o)
  ".objc_class_name_NSData", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSData in libcs106.a(ConsoleTextView.o)
  "_DrawPicture", referenced from:
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_NewEventHandlerUPP", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_NSFileHandleDataAvailableNotification", referenced from:
      _NSFileHandleDataAvailableNotification$non_lazy_ptr in libcs106.a(ConsoleTextView.o)
     (maybe you meant: _NSFileHandleDataAvailableNotification$non_lazy_ptr)
  "_GetEventKind", referenced from:
      MouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in libcs106.a(graphics.o
  "_CloseRgn", referenced from:
      EndFilledRegion()     in libcs106.a(graphics.o)
  "_RemoveEventLoopTimer", referenced from:
      UpdateTitle(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      ShowWindows(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_MoveTo", referenced from:
      DisplayText(double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      RenderArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
      DisplayLine(double, double, double, double)in libcs106.a(graphics.o)
  "_RGBForeColor", referenced from:
      PrepareToDraw()     in libcs106.a(graphics.o)
  "_OpenMovieFile", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  "_IsMovieDone", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  ".objc_class_name_NSMenuItem", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSMenuItem in libcs106.a(mainwrapper.o)
  "_MPSignalSemaphore", referenced from:
      MouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in libcs106.a(graphics.o)
      MouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in libcs106.a(graphics.o)
  "_GetWindowPort", referenced from:
      GetFullScreenWidth()     in libcs106.a(graphics.o)
      GetFullScreenHeight()     in libcs106.a(graphics.o)
      GetMouseY()    in libcs106.a(graphics.o)
      GetMouseX()    in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_CFRelease", referenced from:
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
      UpdateTitle(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_MoviesTask", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  "_EraseRect", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      EraseWindow()     in libcs106.a(graphics.o)
  "_CFBundleGetMainBundle", referenced from:
      ChdirToAppDirectory()     in libcs106.a(mainwrapper.o)
      CreateMenus()     in libcs106.a(mainwrapper.o)
  "_NewMovieFromFile", referenced from:
      PlayNamedSound(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(sound.o)
  "_Gestalt", referenced from:
      IsQuickTimeInstalled()     in libcs106.a(sound.o)
  ".objc_class_name_NSScrollView", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSScrollView in libcs106.a(ConsoleTextView.o)
  "___CFConstantStringClassReference", referenced from:
      cfstring=Version in libcs106.a(mainwrapper.o)
      cfstring=Info: CS106 library built on %s in libcs106.a(mainwrapper.o)
      cfstring= in libcs106.a(mainwrapper.o)
      cfstring=About  in libcs106.a(mainwrapper.o)
      cfstring=Hide  in libcs106.a(mainwrapper.o)
      cfstring=h in libcs106.a(mainwrapper.o)
      cfstring=Edit in libcs106.a(mainwrapper.o)
      cfstring=M in libcs106.a(ConsoleTextView.o)
      cfstring=Console Window in libcs106.a(ConsoleTextView.o)
  "_FrameOval", referenced from:
      RenderArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
  ".objc_class_name_NSBundle", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSBundle in libcs106.a(mainwrapper.o)
      .objc_class_name_NSBundleWithoutSpuriousErrorLog in libcs106.a(mainwrapper.o)
     (maybe you meant: .objc_class_name_NSBundleWithoutSpuriousErrorLog)
  ".objc_class_name_NSFileHandle", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSFileHandle in libcs106.a(ConsoleTextView.o)
  "_GetGraphicsImporterForFile", referenced from:
      GetPictHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_MPExitCriticalRegion", referenced from:
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      EndDrawing()     in libcs106.a(graphics.o)
  "_GraphicsImportGetAsPicture", referenced from:
      GetPictHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_NSFontAttributeName", referenced from:
      _NSFontAttributeName$non_lazy_ptr in libcs106.a(ConsoleTextView.o)
     (maybe you meant: _NSFontAttributeName$non_lazy_ptr)
  ".objc_class_name_NSColor", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSColor in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSTextView", referenced from:
      .objc_class_name_ConsoleTextView in libcs106.a(ConsoleTextView.o)
  "_TextFace", referenced from:
      PrepareToDrawText()     in libcs106.a(graphics.o)
  "_FSPathMakeRef", referenced from:
      GetFSSpec(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FSSpec*)in libcs106.a(sound.o)
  ".objc_class_name_NSNotificationCenter", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSNotificationCenter in libcs106.a(ConsoleTextView.o)
  "_PenMode", referenced from:
      PrepareToDraw()     in libcs106.a(graphics.o)
  ".objc_class_name_NSDictionary", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSDictionary in libcs106.a(mainwrapper.o)
  ".objc_class_name_NSAttributedString", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSAttributedString in libcs106.a(ConsoleTextView.o)
  "_UnlockPixels", referenced from:
      EndDrawing()     in libcs106.a(graphics.o)
  "_DisposeRgn", referenced from:
      EndFilledRegion()     in libcs106.a(graphics.o)
  "_objc_msgSend_fpret", referenced from:
      +[ConsoleTextView contentSizeForPointSize:numRows:numCols:] in libcs106.a(ConsoleTextView.o)
  "_SetGWorld", referenced from:
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      BeginDrawing()     in libcs106.a(graphics.o)
  "_SetRect", referenced from:
      SetRectFromSize(Rect*, int, int, int, int)in libcs106.a(graphics.o)
      SetTextBB(Rect*, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      SetArcBB(Rect*, double, double, double, double, double, double)in libcs106.a(graphics.o)
      SetArcBB(Rect*, double, double, double, double, double, double)in libcs106.a(graphics.o)
      DisplayArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
      RenderArc(double, double, double, double, double, double)in libcs106.a(graphics.o)
      DisplayLine(double, double, double, double)in libcs106.a(graphics.o)
  "_NewEventLoopTimerUPP", referenced from:
      SetWindowTitle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
  "_FillRgn", referenced from:
      EndFilledRegion()     in libcs106.a(graphics.o)
  ".objc_class_name_NSFont", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSFont in libcs106.a(ConsoleTextView.o)
  ".objc_class_name_NSMutableDictionary", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSMutableDictionary in libcs106.a(ConsoleTextView.o)
  "_Button", referenced from:
      MouseButtonIsDown()     in libcs106.a(graphics.o)
  "_SetPort", referenced from:
      GetMouseY()    in libcs106.a(graphics.o)
      GetMouseY()    in libcs106.a(graphics.o)
      GetMouseX()    in libcs106.a(graphics.o)
      GetMouseX()    in libcs106.a(graphics.o)
  "_MPWaitOnSemaphore", referenced from:
      Pause(double)in libcs106.a(graphics.o)
      WaitForMouseUp()     in libcs106.a(graphics.o)
      WaitForMouseDown()     in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_MPCreateSemaphore", referenced from:
      InitGraphics()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
  "_TextWidth", referenced from:
      SetTextBB(Rect*, double, double, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_objc_msgSendSuper", referenced from:
      +[NSBundleWithoutSpuriousErrorLog aloadNibNamed:owner:] in libcs106.a(mainwrapper.o)
      -[ConsoleTextView initWithFrame:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView dealloc] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView setFont:] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView rangeForUserTextChange] in libcs106.a(ConsoleTextView.o)
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
  "_CopyBits", referenced from:
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
  "_CloseComponent", referenced from:
      GetPictHandle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  ".objc_class_name_NSObject", referenced from:
      .objc_class_name_Glue in libcs106.a(mainwrapper.o)
  "_CreateNewWindow", referenced from:
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
  "_TextSize", referenced from:
      PrepareToDrawText()     in libcs106.a(graphics.o)
  "_TextFont", referenced from:
      PrepareToDrawText()     in libcs106.a(graphics.o)
  "_KillPicture", referenced from:
      GetPictureHeight(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      GetPictureWidth(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      DrawNamedPicture(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  "_GetFNum", referenced from:
      GetFontNumber(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
  ".objc_class_name_NSAutoreleasePool", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libcs106.a(mainwrapper.o)
  "_GetMainEventLoop", referenced from:
      SetWindowTitle(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      InitGraphics()     in libcs106.a(graphics.o)
  "_FSGetCatalogInfo", referenced from:
      GetFSSpec(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, FSSpec*)in libcs106.a(sound.o)
  "_ConvertEventRefToEventRecord", referenced from:
      MouseEventHandler(OpaqueEventHandlerCallRef*, OpaqueEventRef*, void*) in libcs106.a(graphics.o)
  "_SetEventLoopTimerNextFireTime", referenced from:
      UpdateDisplay()     in libcs106.a(graphics.o)
  "_NSForegroundColorAttributeName", referenced from:
      _NSForegroundColorAttributeName$non_lazy_ptr in libcs106.a(ConsoleTextView.o)
     (maybe you meant: _NSForegroundColorAttributeName$non_lazy_ptr)
  "_GetPortBounds", referenced from:
      GetFullScreenWidth()     in libcs106.a(graphics.o)
      GetFullScreenHeight()     in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CopyBitsOnscreen(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
      CreateGraphicsWindow()     in libcs106.a(graphics.o)
      EraseWindow()     in libcs106.a(graphics.o)
  "_NSBeep", referenced from:
      -[ConsoleTextView keyDown:] in libcs106.a(ConsoleTextView.o)
  "_CFStringCreateWithCString", referenced from:
      UpdateTitle(__EventLoopTimer*, void*) in libcs106.a(graphics.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

有人能让我知道我的节目有什么问题吗?

谢谢! Ĵ

1 个答案:

答案 0 :(得分:4)

编译器抱怨它在任何地方都找不到的类和方法。他们听起来都很熟悉,所以我相信你需要在你的Xcode项目中添加几个Mac OS X frameworks的引用:

  

Carbon.framework

     

Cocoa.framework

     

QuickTime.framework

您可以通过右键单击项目资源管理器并使用“添加/现有框架...”命令来执行此操作。

您可能更愿意使用assignment 0 source code for Mac作为起点,因为已经配置了包含的Xcode项目,链接到课程实用程序库并引用所有需要的框架。