views:

77

answers:

2

Hello,

I have the following problem: I'm linking against the Admob library which contains some part of the GData API. But I also want to link with the GData static library to use it directly in my own application.

Of course, I get duplicate symbols at link time.

How can I avoid that?

A: 

There is no way to do that. You may want to read my related answer here. Basically there is only one way for you to do this: Modify the Admob library such that it uses the same GData static library.

On second thought, I'd say you could also load either of the libraries at runtime. The name conflicts will persist, but each objective-C symbol will be overridden. Not sure whether this really works. The first method is nicer, too.

Max Seelemann
+1  A: 

The Objective-C GData library includes a header, GDataTargetNamespace.h, with macros to redefine every class in the library.

You can include the header in your project and define a prefix in your target build settings, like

-DGDATA_TARGET_NAMESPACE=MyApp

That will add the prefix to every class in the GData library for your application.

This is really a bug in the Admob library, though.

grobbins
As far as I've been able to determine, AdMob doesn't use GData in their library, so perhaps the conflict comes from some other source.
Greg Robbins