开发者

Objective C: Version of JSON library I'm compiling in present in another library I'm linking in via .a, how to resolve conflict?

I'm compiling in a local version of the SBJson library into my iPad project. I just started linking in a static .a library that has compiled symbols that collide with objects in the SBJson library. I am able to modify the SBJson library, what is the best way to modify it to avoid th开发者_如何学Ce name collisions?


I had a similar problem with expat a few years ago. Basically, we prefixed all the publicly exported functions/classes with some string that would designate it as being ours. So if a function was called foo, it would be PREFIX_foo. Likewise for classes. Then you'd change the classes in your code to use your prefixed versions.

What you can also try is just using the headers to compile and removing your link line. That is a bit risky since you don't know what version is in that static lib or if it was modified (or do you?)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜