Leg10n
Leg10n

Reputation: 552

Updating library gives me Symbol(s) not found in xcode

I have this mobclix lib, I had an older version but I wanted to update it, I removed the old .a file and headers, and added the new ones, but I get the error message saying:

"_OBJ_CLASS_$_MobclixAdViewiPhone_320x50", referenced from:
Objc-class-ref-to-MobclixAdViewiPhone_320x50 in AdManager.o
Symbol(s) not found
Collect2: ld returned 1 exit status

I Already have the lib in the target "linked libraries", did a clean, restarted xcode, and still I get the same error message.

This has occured in the past, and I didn't find any answer, I had to make a new project, but I think it's a waste of time. Please help.

Upvotes: 1

Views: 965

Answers (2)

d11wtq
d11wtq

Reputation: 35298

Completely delete the library from the Xcode project and then re-add it, along with re-adding it to your link phase. Sounds like Xcode is stuck trying to link with a library that no longer exists.

Failing that:

  1. Add a new build phase: Right click the target, Add -> New Build Phase -> New Copy Files Build Phase.
  2. Set the destination to "Products Directory".
  3. Drag your library into this build phase, and then;
  4. (Important!) drag the position of the new build phase so it's ordered before the compile phase.

This is needed if the library isn't actually installed in a system path. There are other ways to achieve the same effect, but this one is nice and portable.

Upvotes: 0

hooleyhoop
hooleyhoop

Reputation: 9198

MobclixAdViewiPhone_320x50 is not being found so you are not linking mobclix correctly. Got to love XCode: having the library in your target's "Link Binary With Libraries" section doesn't mean that the library will be linked. You must make sure that your target's Build Settings > Library Search Paths contains the correct path to the lib.

Upvotes: 1

Related Questions