Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么赢了';AVT基础链接与我的XCode 3.2.3 iPhone 4.0.1项目?_Iphone_Avfoundation - Fatal编程技术网

为什么赢了';AVT基础链接与我的XCode 3.2.3 iPhone 4.0.1项目?

为什么赢了';AVT基础链接与我的XCode 3.2.3 iPhone 4.0.1项目?,iphone,avfoundation,Iphone,Avfoundation,我正在按照参考资料从iPhone摄像头捕获视频。除了那一页的代码之外,这是一个新的项目。我还向项目中添加了AVFoundation框架。以下是我得到的链接器错误: Build my project of project my project with configuration Debug CompileC "build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/MainViewControlle

我正在按照参考资料从iPhone摄像头捕获视频。除了那一页的代码之外,这是一个新的项目。我还向项目中添加了AVFoundation框架。以下是我得到的链接器错误:

Build my project of project my project with configuration Debug

CompileC "build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/MainViewController.o" /Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m normal armv6 objective-c com.apple.compilers.gcc.4_2
cd /Users/mwilliamson/Projects/my_project/iphone
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c -arch armv6 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 -iquote "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-generated-files.hmap" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-own-target-headers.hmap" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-all-target-headers.hmap" -iquote "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-project-headers.hmap" -F/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -I/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos/include -I/Users/mwilliamson/Projects/my_project/iphone/opencv_device/include "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/DerivedSources/armv6" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/DerivedSources" -include /var/folders/kW/kW6u6B7SGyGYu+nNumtIa++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/my_project_Prefix-alujyqxskcuyuogdsynmjyrkxbhh/my_project_Prefix.pch -c /Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m -o "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/MainViewController.o"

/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m: In function '-[MainViewController captureOutput:didOutputSampleBuffer:fromConnection:]':
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: 'MainViewController' may not respond to '-imageFromSampleBuffer:'
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: (Messages without a matching method signature
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: will be assumed to return 'id' and accept
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: '...' as arguments.)

Ld "build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/my project" normal armv6
cd /Users/mwilliamson/Projects/my_project/iphone
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -F/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -filelist "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/my project.LinkFileList" -dead_strip -lz -lstdc++ /Users/mwilliamson/Projects/my_project/iphone/opencv_device/lib/libcxcore.a /Users/mwilliamson/Projects/my_project/iphone/opencv_device/lib/libcv.a -miphoneos-version-min=4.0 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -o "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv6/my project"

Undefined symbols:
  "_CVPixelBufferGetBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferLockBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CMSampleBufferGetImageBuffer", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferGetHeight", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
      _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr in MainViewController.o
     (maybe you meant: _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr)
  "_CVPixelBufferGetWidth", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferGetBytesPerRow", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CMTimeMake", referenced from:
      -[MainViewController setupCaptureSession] in MainViewController.o
  "_CVPixelBufferGetDataSize", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

CompileC "build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv7/MainViewController.o" /Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m normal armv7 objective-c com.apple.compilers.gcc.4_2
cd /Users/mwilliamson/Projects/my_project/iphone
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -x objective-c -arch armv7 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wunused-variable -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -fvisibility=hidden -gdwarf-2 -mthumb -miphoneos-version-min=4.0 -iquote "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-generated-files.hmap" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-own-target-headers.hmap" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-all-target-headers.hmap" -iquote "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/my project-project-headers.hmap" -F/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -I/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos/include -I/Users/mwilliamson/Projects/my_project/iphone/opencv_device/include "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/DerivedSources/armv7" "-I/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/DerivedSources" -include /var/folders/kW/kW6u6B7SGyGYu+nNumtIa++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/my_project_Prefix-gtrotaxhqdjhgqbqbsnyeqjkaxdt/my_project_Prefix.pch -c /Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m -o "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv7/MainViewController.o"

/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m: In function '-[MainViewController captureOutput:didOutputSampleBuffer:fromConnection:]':
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: 'MainViewController' may not respond to '-imageFromSampleBuffer:'
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: (Messages without a matching method signature
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: will be assumed to return 'id' and accept
/Users/mwilliamson/Projects/my_project/iphone/Classes/MainViewController.m:126: warning: '...' as arguments.)

Ld "build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv7/my project" normal armv7
cd /Users/mwilliamson/Projects/my_project/iphone
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk -L/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -F/Users/mwilliamson/Projects/my_project/iphone/build/Debug-iphoneos -filelist "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv7/my project.LinkFileList" -dead_strip -lz -lstdc++ /Users/mwilliamson/Projects/my_project/iphone/opencv_device/lib/libcxcore.a /Users/mwilliamson/Projects/my_project/iphone/opencv_device/lib/libcv.a -miphoneos-version-min=4.0 -framework Foundation -framework UIKit -framework CoreGraphics -framework AVFoundation -o "/Users/mwilliamson/Projects/my_project/iphone/build/my project.build/Debug-iphoneos/my project.build/Objects-normal/armv7/my project"

Undefined symbols:
  "_CVPixelBufferGetBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferUnlockBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferLockBaseAddress", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CMSampleBufferGetImageBuffer", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferGetHeight", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_kCVPixelBufferPixelFormatTypeKey", referenced from:
      _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr in MainViewController.o
     (maybe you meant: _kCVPixelBufferPixelFormatTypeKey$non_lazy_ptr)
  "_CVPixelBufferGetWidth", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CVPixelBufferGetBytesPerRow", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
  "_CMTimeMake", referenced from:
      -[MainViewController setupCaptureSession] in MainViewController.o
  "_CVPixelBufferGetDataSize", referenced from:
      -[MainViewController imageFromSampleBuffer:] in MainViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

我再一次回答我自己的问题。。。。我还需要添加CoreVideo和CoreMedia框架。

我花了几个小时来解决这个问题。我发布这篇文章是为了帮助其他可能处于同样情况的人。我已经将CoreVideo和CoreMedia链接到我的项目。然而,我仍然遇到这个问题。经过大量的搜索和尝试,我发现了这篇文章。以下是我的解决方案:

1) 删除有问题的库(在我的例子中是CoreVideo和CoreMedia)。要做到这一点,请在项目导航中删除它们,并选择“删除引用”,然后在“构建阶段”中的链接框架中删除它们


2) 再次添加框架,清理并重新编译。

谢谢,我也遇到了同样的问题,您的解决方案非常有效!谢谢你,马特。文件很差。表示只需使用AVFoundation即可。对于苹果的新手来说,这会让事情变得更糟。为什么xcode在没有包含框架的情况下表现得像框架一样可用?