SIMBL (Method Swizzling) linker error

Discussion in 'Mac Programming' started by Avicenna, Mar 21, 2011.

  1. Avicenna macrumors member

    Jul 16, 2009
    I am trying to modify a program using SIMBL. I am swapping methods and I have the class IMWindowController categorized with the new implementation of the method. When I build the bundle I get this linker error:
    "_OBJC_CLASS_$_IMWindowController", referenced from: l_OBJC_$_CATEGORY_IMWindowController_$_Injected in MyInjector.o objc-class-ref-to-IMWindowController in MyInjector.o ld: symbol(s) not found
    I google this type of errors and I figuered out that I need to some binary, but I don't know:
    1. Which binary
    2. And how to link that binary

    If someone could point me in the right direction, it would be great. Thanks.
  2. jiminaus, Mar 21, 2011
    Last edited: Mar 21, 2011

    jiminaus macrumors 65816


    Dec 16, 2010
    I have no experience with SIMBL.

    Generally in Objective-C, this is a symbol that is generated by the compiler as part of the runtime metadata infrastructure of a class. It's emitted as part of the @implementation directive. Where is the implementation of IMWindowController? If it's in a library or framework somewhere, have to linked to the library or framework? If it's in .m file you've coded, is it being compiled and the resultant .o file being linked in?

    EDIT: As a hunch I compared the metadata output in the classic runtime verses the modern runtime. They are different. You might want to check that your compiling for the same architecture as the program your hacking. By default XCode projects are setup to only compile 64-bit code for the modern runtime in debug builds. Try changing the architecture to only i386 to build code for the classic runtime.

Share This Page