编译libx264时出错:架构x86_64的未定义符号

时间:2015-02-23 02:40:34

标签: ffmpeg libx264

我安装了ffmpeg,我正在尝试编译libx264但是一直出错。我从搜索中发现的大多数结果都是关于编译ffmpeg或用libx264配置它的问题,但我似乎甚至无法编译libx264。

这是错误:

Undefined symbols for architecture x86_64:
  "_CFDataCreate", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
      _vda_h264_end_frame in libavcodec.a(vda_h264.o)
  "_CFDictionaryCreateMutable", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_CFDictionarySetValue", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_CFNumberCreate", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_CFRelease", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
      _vda_h264_end_frame in libavcodec.a(vda_h264.o)
  "_CVPixelBufferGetBaseAddress", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferGetBaseAddressOfPlane", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferGetBytesPerRow", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferGetBytesPerRowOfPlane", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferGetPixelFormatType", referenced from:
      _vda_decoder_callback in libavcodec.a(vda_h264.o)
  "_CVPixelBufferGetPlaneCount", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferIsPlanar", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferLockBaseAddress", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
  "_CVPixelBufferRelease", referenced from:
      _release_buffer in libavcodec.a(vda_h264_dec.o)
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _vda_h264_uninit in libavcodec.a(vda_h264.o)
      _ff_vda_output_callback in libavcodec.a(vda_h264.o)
      _release_buffer in libavcodec.a(vda_h264.o)
      _vda_h264_release_buffer in libavcodec.a(vda_h264.o)
  "_CVPixelBufferRetain", referenced from:
      _vdadec_decode in libavcodec.a(vda_h264_dec.o)
      _vda_decoder_callback in libavcodec.a(vda_h264.o)
      _ff_vda_output_callback in libavcodec.a(vda_h264.o)
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      _release_buffer in libavcodec.a(vda_h264_dec.o)
  "_VDADecoderCreate", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_VDADecoderDecode", referenced from:
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _vda_h264_end_frame in libavcodec.a(vda_h264.o)
  "_VDADecoderDestroy", referenced from:
      _ff_vda_destroy_decoder in libavcodec.a(vda_h264.o)
  "_VDADecoderFlush", referenced from:
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _vda_h264_end_frame in libavcodec.a(vda_h264.o)
  "_iconv", referenced from:
      _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
  "_iconv_close", referenced from:
      _avcodec_open2 in libavcodec.a(utils.o)
      _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
  "_iconv_open", referenced from:
      _avcodec_open2 in libavcodec.a(utils.o)
      _avcodec_decode_subtitle2 in libavcodec.a(utils.o)
  "_kCFAllocatorDefault", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _vda_old_h264_end_frame in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
      _vda_h264_end_frame in libavcodec.a(vda_h264.o)
  "_kCFCoreFoundationVersionNumber", referenced from:
      _vdadec_init in libavcodec.a(vda_h264_dec.o)
  "_kCFTypeDictionaryKeyCallBacks", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kCFTypeDictionaryValueCallBacks", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kCVPixelBufferIOSurfacePropertiesKey", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kVDADecoderConfiguration_Height", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kVDADecoderConfiguration_SourceFormat", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kVDADecoderConfiguration_Width", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_kVDADecoderConfiguration_avcCData", referenced from:
      _ff_vda_create_decoder in libavcodec.a(vda_h264.o)
      _ff_vda_default_init in libavcodec.a(vda_h264.o)
  "_swr_alloc", referenced from:
      _opus_decode_init in libavcodec.a(opusdec.o)
  "_swr_close", referenced from:
      _opus_decode_packet in libavcodec.a(opusdec.o)
      _opus_decode_flush in libavcodec.a(opusdec.o)
  "_swr_convert", referenced from:
      _opus_decode_packet in libavcodec.a(opusdec.o)
  "_swr_free", referenced from:
      _opus_decode_close in libavcodec.a(opusdec.o)
  "_swr_init", referenced from:
      _opus_decode_packet in libavcodec.a(opusdec.o)
  "_swr_is_initialized", referenced from:
      _opus_decode_packet in libavcodec.a(opusdec.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [x264] Error 1

更新:我只是使用自制软件来安装ffmpeg和libx264。

2 个答案:

答案 0 :(得分:4)

您需要将以下框架添加到您的项目中:VideoDecodeAcceleration.framework,CoreVideo.framework,CoreFoundation.framework

要添加它们,请选择您的目标,转到“构建阶段 - >使用库链接二进制文件”,然后单击+按钮并选择您的框架。之后一切都应该编译。

答案 1 :(得分:1)

如果您只需要libx264并且不需要x264 cli而不是在使用./configure --disable-lavf配置期间禁用lavf输入,因为它存在libavcodec / libavformat(lavf)依赖项的问题。