views:

63

answers:

1

Hello,

I have an objc app that has the class Foobar and I want to make a dylib that will be loaded into that app on start and extends the class Foobar with a few methods.

Unfortunately I cannot build the library, I get the following linker error:

  "_OBJC_CLASS_$_Foobar", referenced from:


      __objc_const@0 in Foobar+MyStuff.o


      __objc_classrefs__DATA@0 in Foobar+MyStuff.o


ld: symbol(s) not found


collect2: ld returned 1 exit status

Is there some linker flag that tells ld to ignore that missing symbol?

Thanks a lot!

A: 

Hi Kim,

If you add the following arguments to the "Other Linker Flags" section of your target, it will ignore the missing symbols and allow you to do what you're trying to do.

-force_flat_namespace -undefined suppress

PS: This is for the Mac. No idea how or if this applies to iPhone.

Ken Aspeslagh