views:

31

answers:

1

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 the name collisions?

+1  A: 

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?)

SB