While using two static library in project, conflic

2019-07-18 05:30发布

I have implemented two static library having the following structure:

FirstStaticLibrary.a

BaseClass.h

@interface BaseClass

-some methods

@end

FirstDerivedClass.h

@interface FirstDerivcedClass:BaseClass
{
}

-some methods

@end

SecondStaticLibrary.a

BaseClass.h

@interface BaseClass

-some methods;

@end

SecondDerivedClass.h

@interface SecondDerivedClass:BaseClass
{
}

-someMethods;

@end

Above two static library is having the common file BaseClass.h and BaseClass.m

These static libraries are added into TestApplication Project.

But while running the application, it's throwing an error:

Duplicate symbols found in /User/Library/Developer/Xcode/..E./FirstStaticLibrary.a (BaseClass.o) and /User/Library/Developer/Xcode/..E./SecondStaticLibrary.a (BaseClass.o) for architecture i386

Please suggest a way to remove this error.

2条回答
Evening l夕情丶
2楼-- · 2019-07-18 05:58

This answer is probably one you will want to hear! I managed to find a solution that works! Hopefully others will learn that even when they include other APIs into their frameworks, they still always need to place their prefix on the classes. Look here.

查看更多
Fickle 薄情
3楼-- · 2019-07-18 06:03

The answer is one you probably don't want to hear, but you will have to change the name in one of your libraries. Assuming you have access to both libraries that is.

查看更多
登录 后发表回答