0

I'm trying to add this iOS lib PTImageAlbumViewController to an existing project that I'm working on and I'm getting compile errors. There is a sample project included and its dependent on a couple of other libs. The sample project works just fine but I can't get it migrated to my own project without errors. I tried pulling the files direct from the project by dragging them from project to project but its still not working

Is there something I'm missing?

Undefined symbols for architecture armv7: "_OBJC_METACLASS_$_NetworkPhotoAlbumViewController", referenced from: _OBJC_METACLASS_$_PTImageAlbumViewController in PTImageAlbumViewController.o "_OBJC_CLASS_$_NIPhotoAlbumScrollView", referenced from: _OBJC_CLASS_$_PTImageAlbumView in PTImageAlbumView.o "_OBJC_CLASS_$_NetworkPhotoAlbumViewController", referenced from: _OBJC_CLASS_$_PTImageAlbumViewController in PTImageAlbumViewController.o "_NIPathForBundleResource", referenced from: -[PTImageAlbumViewController viewDidLoad] in PTImageAlbumViewController.o "_OBJC_METACLASS_$_NIPhotoAlbumScrollView", referenced from: _OBJC_METACLASS_$_PTImageAlbumView in PTImageAlbumView.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)

ChickensDontClap
  • 1,871
  • 4
  • 22
  • 39

2 Answers2

1

What it can't find is the nimbus files.

If you have added the nimbus and SDURLCache files to your project, then it should just be a matter of making sure they're included in your application's target.

Make sure ALL the files got into your project and are in the right target. For example, the first error is regarding NetworkPhotoAlbumViewController.m. Is that file in your project and in the right target?

If so, the one other possibility is that it's simply not building for this architecture for some reason. You can find out by navigating the tree from your DerivedData directory down to where the object files are stored and using nm to search the object files for the missing symbols.

Example on my machine:

cd /Users/username/Library/Developer/Xcode/DerivedData/AlbumDemo-eyqszubjyqhczreurkblqktoxjja/Build/Intermediates/AlbumDemo.build/Debug-iphonesimulator/AlbumDemo.build/Objects-normal/i386

nm NetworkPhotoAlbumViewController.o | grep _NetworkPhotoAlbumViewController
00000000 t -[NetworkPhotoAlbumViewController shutdown_NetworkPhotoAlbumViewController]
0000e0fc s -[NetworkPhotoAlbumViewController shutdown_NetworkPhotoAlbumViewController].eh
0000cde8 S _OBJC_CLASS_$_NetworkPhotoAlbumViewController
0000c9b4 S _OBJC_IVAR_$_NetworkPhotoAlbumViewController._activeRequests
0000c9bc S _OBJC_IVAR_$_NetworkPhotoAlbumViewController._highQualityImageCache
0000c9b0 S _OBJC_IVAR_$_NetworkPhotoAlbumViewController._queue
0000c9b8 S _OBJC_IVAR_$_NetworkPhotoAlbumViewController._thumbnailImageCache
0000cdfc S _OBJC_METACLASS_$_NetworkPhotoAlbumViewController
0000cfe0 s l_OBJC_$_INSTANCE_METHODS_NetworkPhotoAlbumViewController
0000d084 s l_OBJC_$_INSTANCE_VARIABLES_NetworkPhotoAlbumViewController
0000d0e0 s l_OBJC_$_PROP_LIST_NetworkPhotoAlbumViewController
0000d100 s l_OBJC_CLASS_RO_$_NetworkPhotoAlbumViewController
0000cfb8 s l_OBJC_METACLASS_RO_$_NetworkPhotoAlbumViewController

The fact that these symbols do not have a "U" in the second column means that they are defined in this object file. You can find the meaning of all the nm output from the nm man page.

wadesworld
  • 13,535
  • 14
  • 60
  • 93
  • 1
    Thank you very much for the additional information and resources! Turns out that I added the files to the project but they were not part of the compiled sources. Not sure why they weren't added automatically because I did have the 'add to target' button checked. – ChickensDontClap May 17 '12 at 22:19
0

Sometimes when you create a new Class file Xcode doesn't add it to the "Compiled Sources"

Select Project Icon > Targets > Build Phases > Compile Sources

And click the + button to add the Class *.m file.

David Douglas
  • 10,377
  • 2
  • 55
  • 53