Linking problem in Xcode when using a dependent subproject


Issue

Undefined symbols:
  "_AVCaptureSessionPresetMedium", referenced from:
      _AVCaptureSessionPresetMedium$non_lazy_ptr in libZXingWidget.a(ZXingWidgetController.o)
     (maybe you meant: _AVCaptureSessionPresetMedium$non_lazy_ptr)
  "_CVPixelBufferGetHeight", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferLockBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_AudioServicesPlaySystemSound", referenced from:
      -[ZXingWidgetController presentResultForString:] in libZXingWidget.a(ZXingWidgetController.o)
  "_AudioServicesCreateSystemSoundID", referenced from:
      -[ZXingWidgetController viewWillAppear:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferGetBaseAddress", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferGetBytesPerRow", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_iconv_close", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
      zxing::qrcode::DecodedBitStreamParser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
  "_OBJC_CLASS_$_AVCaptureVideoPreviewLayer", referenced from:
      objc-class-ref-to-AVCaptureVideoPreviewLayer in libZXingWidget.a(ZXingWidgetController.o)
  "_iconv", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
  "_OBJC_CLASS_$_AVCaptureSession", referenced from:
      objc-class-ref-to-AVCaptureSession in libZXingWidget.a(ZXingWidgetController.o)
  "_OBJC_CLASS_$_AVCaptureDevice", referenced from:
      objc-class-ref-to-AVCaptureDevice in libZXingWidget.a(ZXingWidgetController.o)
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
      _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr in libZXingWidget.a(ZXingWidgetController.o)
     (maybe you meant: _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr)
  "_OBJC_CLASS_$_AVCaptureVideoDataOutput", referenced from:
      objc-class-ref-to-AVCaptureVideoDataOutput in libZXingWidget.a(ZXingWidgetController.o)
  "_CVPixelBufferGetWidth", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_AudioServicesDisposeSystemSoundID", referenced from:
      -[ZXingWidgetController dealloc] in libZXingWidget.a(ZXingWidgetController.o)
  "_OBJC_CLASS_$_AVCaptureDeviceInput", referenced from:
      objc-class-ref-to-AVCaptureDeviceInput in libZXingWidget.a(ZXingWidgetController.o)
  "_AVLayerVideoGravityResizeAspectFill", referenced from:
      _AVLayerVideoGravityResizeAspectFill$non_lazy_ptr in libZXingWidget.a(ZXingWidgetController.o)
     (maybe you meant: _AVLayerVideoGravityResizeAspectFill$non_lazy_ptr)
  "_CMSampleBufferGetImageBuffer", referenced from:
      -[ZXingWidgetController captureOutput:didOutputSampleBuffer:fromConnection:] in libZXingWidget.a(ZXingWidgetController.o)
  "_iconv_open", referenced from:
      zxing::qrcode::DecodedBitStreamParser::append(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned char const*, unsigned long, char const*)in libZXingWidget.a(DecodedBitStreamParser-64E27B33E79CBC52.o)
  "_AVMediaTypeVideo", referenced from:
      _AVMediaTypeVideo$non_lazy_ptr in libZXingWidget.a(ZXingWidgetController.o)
     (maybe you meant: _AVMediaTypeVideo$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status

SOlutions:
make sure include "CoreMedia.framework","AudioToolbox.framework","CoreGraphics.framework","CoreVideo.framework","AVFoundation.framework","libiconv.dylib" frameworks in project in Build Phases
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s