开发者

Linker Error - Project not cleaning entirely?

开发者 https://www.devze.com 2023-04-05 14:30 出处:网络
I\'m going to apologize in advance here.The project I\'m working is under a couple NDAs so I\'m not going to be able to be as specific as I would normally want to.

I'm going to apologize in advance here. The project I'm working is under a couple NDAs so I'm not going to be able to be as specific as I would normally want to.

I'm working on an iOS project that includes a pre-compiled library in the form of a .h and .a file. I started development with a particular version of this library and everything was working fine. They've since released a new version that I need for a particular new feature.

Between the old and new versions, several of the function names have changed. When I update my code to call the new methods, I'm getting an Apple Mach-O Linker Error at compile time: (Names have been changed to protect the innocent)

Undefined symbols for architecture armv7:
  "methodName", referenced from:
    myMethod()      in MyClass.o
ld: symbol(s) not found for architecture armv7
collect2: ld returned 1 exit status

I know it looks like it just doesn't include armv7 code, but that's actually a red herring. If I set the architecture build setting for both the project and target to Standard (armv6 armv7), I get the same linker error, except it'll say armv6.

The problem is, I can put the new .h and .a files in a new project and call this same method and not get the linker error!

I have a feeling that there's something that isn't getting cleaned and it's trying to compile against the old .a file. I'm using Xcode 4.1 on Snow Leopard. I've tried removing the file from the project, deleting the .a file from the Link Binary With Libraries section under 开发者_如何转开发Build Phases for the target, cleaning, adding back the .a file and rebuilding and I still get the error.I'm starting to go crazy here.


OK - I found the culprit! Naturally, it was in Build Settings.

When I switched to the new version, I put the new library in a folder next to the old one, in case I had to switch back at some point. Apparently, when I removed the old version, it did not remove the path to the old version of the .a file from Library Search Paths in the build settings for the target. Deleted the old path, everything is working again.

0

精彩评论

暂无评论...
验证码 换一张
取 消