Undefined symbols

Discussion in 'Mac Programming' started by NeoDarkboy, Mar 10, 2011.

  1. NeoDarkboy, Mar 10, 2011
    Last edited by a moderator: Mar 10, 2011

    NeoDarkboy macrumors newbie

    Joined:
    Mar 10, 2011
    #1
    Hi, is me again :p, i have this error while linkin:

    Code:
    Undefined symbols:
      ".objc_class_name_AppDelegate", referenced from:
          .objc_class_name_MyAppDelegate in MyAppDelegate.o
      ".objc_class_name_GLView", referenced from:
          .objc_class_name_MyAppView in MyAppView.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    AppDelegate and GLView are inside a library, and MyAppDelegate and MyAppView are in a main project.

    The target of the main project includes the library.a.

    AppDelegate and GLView are added to the target compile sources, same for MyAppDelegate and MyAppView


    Here is the code:

    MyAppDelegate.h:

    Code:
    #import <Cocoa/Cocoa.h>
    #import <lib/AppDelegate.h>
    @interface MyAppDelegate : AppDelegate {
    
    }
    MyAppDelegate.mm

    Code:
    #import "MyAppDelegate.h"
    
    @implementation GameDelegate
    
    @end
    AppDelegate.h:

    Code:
    #import <Cocoa/Cocoa.h>
    #import <QTKit/QTKit.h>
    #import <GLView.h>
    
    @interface AppDelegate : NSObject <NSApplicationDelegate, NSWindowDelegate> {
    
    }
    @end
    GLView.h:

    Code:
    #import <Cocoa/Cocoa.h>
    #import <QuartzCore/CVDisplayLink.h>
    
    @interface EAGLView : NSView {
    
    }
    @end
     
  2. NeoDarkboy thread starter macrumors newbie

    Joined:
    Mar 10, 2011
    #2
    Ok, i resolved the problem, after checkin there weren't duplicated librarys, in targets/link binary with librarys and Library Search Paths, and check that the files are added to the compile sources, i detected that the problem was that in the project get info, in Build, was unchecked the Build Active Architecture Only, so i checked, and my problem was fixed. The linkin error was from another arch that i wast using.

    Me and Xcode are not good friends :(

    Well hope this help somebody else :)
     

Share This Page