3

I'm trying to import some libraries into a today extension (working fine in the main app). When I run the app, I get the errors:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Budget", referenced from:
      objc-class-ref in TodayViewController.o
  "_OBJC_CLASS_$_JBBarChartView", referenced from:
      objc-class-ref in TodayViewController.o
  "_OBJC_CLASS_$_Users", referenced from:
      objc-class-ref in TodayViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Here are the imports:

#import "JBBarChartView.h"
#import "JBChartView.h"
#import "Users.h"
#import "Budget.h"

Any suggestions?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
spogebob92
  • 1,474
  • 4
  • 23
  • 32
  • 3
    Select the file and in the file inspector, set the target to your todays extension's target to make the file available to the target. – Sandeep Oct 29 '14 at 20:05
  • @insane-36 the target membership area is greyed out. Would you happen to know why? – spogebob92 Oct 29 '14 at 20:11
  • Ignore me. .m files... not the implementation files. – spogebob92 Oct 29 '14 at 20:12
  • OKay, so I've sorted the target memberships out, but now I've received over 20+ 'parse errors' with files that were working fine before. – spogebob92 Oct 29 '14 at 20:14
  • 1
    Ok, if you have parsing error, that means there is some error. Resolve the error. – Sandeep Oct 29 '14 at 20:56
  • Did you ever figure out the solution to this? I'm seeing the same thing. – Alexander Sep 16 '16 at 22:48
  • Yes. With the imports you want to use, click on the files (i.e Users.h) and check the target membership in the right hand question mark column, and make sure all the targets are selected. :) – spogebob92 Sep 19 '16 at 09:08

1 Answers1

0

If you use pods and import some libraries,you can edit Podfile like this:

target 'MyApp' do
  pod 'GoogleAnalytics', '~> 3.1'

  # Has its own copy of OCMock
  # and has access to GoogleAnalytics via the app
  # that hosts the today target

  target 'MyAppToday' do
    inherit! :search_paths
    pod 'OCMock', '~> 2.0.1'
  end
end

If you want use your own class,click this file and check the target membership.You also can pack these file as a framework.

coderL
  • 73
  • 1
  • 7