9

My other libraries not allow me to set -ObjC or all_load flags. So I need to use -force_load to link my library.

I have "GoogleOpenSource.framework" & "GooglePlus.framework" under my project, so how can I map those correctly to work.

I have set paths like this:

-force_load $(PROJECT_DIR)/Project_name/GooglePlus.framework/Versions/A/Headers/GooglePlus.h

-force_load $(PROJECT_DIR)/Project_name/GoogleOpenSource.framework/Versions/A/Headers/GoogleOpenSource.h

under the Other linker flags, but it's not working.

What am I doing wrong here?

Cœur
  • 37,241
  • 25
  • 195
  • 267
RJ168
  • 1,006
  • 2
  • 12
  • 22

2 Answers2

3

I faced the same issue, but finally i fixed this by below mentioned steps:-

Steps

  1. Go to the "other linker flags" inside your project's build settings and then
  2. Add -force_load $(PROJECT_DIR)/yourframewokname.framework/yourframeworkname

Note** The framework which requires to add -ObjC flag inside the other linker flag in that case it conflicts with other libraries so in this case you need to force load the library which requires -ObjC.

Use above mentioned steps it works.

Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
Amit Thakur
  • 1,081
  • 12
  • 14
1

-force_load flag is for loading static libraries, so you put the library archive, NOT the header file as the parameter.

Use the following instead:

-force_load GooglePlus.framework/Versions/Current/GooglePlus
-force_load GoogleOpenSource.framework/Versions/Current/GoogleOpenSource
technophyle
  • 7,972
  • 6
  • 29
  • 50