Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Creating Spotlight Plugins
Subject:   Linker errors ...
Date:   2005-07-18 06:37:26
From:   SADev
I'm getting the following during linking ...


/usr/bin/ld: Undefined symbols:
_GetMetadataForFile
.objc_class_name_NSConstantString
.objc_class_name_NSDate
.objc_class_name_NSMutableArray
.objc_class_name_NSMutableAttributedString
.objc_class_name_NSMutableDictionary
.objc_class_name_NSNumber
.objc_class_name_NSObject
.objc_class_name_Protocol
__NSConstantStringClassReference
_objc_msgSend
_objc_msgSendSuper
collect2: ld returned 1 exit status


I've #import'd foundation and cocoa. What's up?


Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • Matthew Russell photo Linker errors ...
    2005-07-18 07:56:38  Matthew Russell | O'Reilly AuthorO'Reilly Blogger [View]

    A couple of things to consider when tackling these kinds of problems:

    -Are you using the project file that's provided and getting this error, or did you follow along, building up the project from scratch and get this error? If you followed along, you might want to download the project file provided and compare the two to see what's up. I can build the one provided without any modifications on both XCode 2.0 and 2.1 and get a clean build.

    -One thing to pay particular attention to when linking is to remember that while #import-ing things gets you successful compilation, you still have to add the required frameworks to the project (left hand pane under the "External Frameworks..." folder) to get it to link successfully.

    -Did you rename GetMetadataForFile.c to GetMetadataForFile.m ? I get an error very similar to the one you get if this file isn't renamed to have a ".m" extension.

    Try these things out and let me know what happens. No doubt, your experieces will save someone time when they have similar encounters.
    • Linker errors ...
      2005-07-18 11:00:50  SADev [View]

      I had forgotten to add the frameworks to my project. D'oh!