Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

-all_load other linker flag causing duplicate symbol errors in 3rd party framework

I have a static library we use for in-house apps that contains some common utility code. From previous SO posts, I have found that in order to get categories in the static library to be loaded at run-time, I need to include -all_load -ObjC in the Other Linker Flags field in Build Settings.

However, with a closed-source, 3rd party library that I am also using, if I use these flags, I get several duplicate symbol errors. I have verified that I can get the app to build by taking these flags out, but of course, at runtime I get unrecognized selector crashes when using category methods.

Is there any way to target the -all_load -ObjC to only be applied to my static library, somehow?

Thanks!

like image 222
cscott530 Avatar asked Jan 16 '13 22:01

cscott530


1 Answers

Try using the -force_load flag instead

check this post for more details.

like image 184
Mark Pauley Avatar answered Nov 13 '22 10:11

Mark Pauley