vsimon / webrtcbuilds

Getting started with WebRTC natively is no easy picnic. The goal of webrtcbuilds is to provide a single standalone WebRTC static library and package.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

run_tests.sh (building the example) fails

alexanderb14 opened this issue · comments

Hi,

after successfully building WebRTC on MacOS El Capitan, I am trying to execute the run_tests.sh script.

However, this fails with the following linking error:

➜ test git:(master) ✗ ./run_tests.sh ../out/webrtcbuilds-14720-3355f6d-mac-x64/
Undefined symbols for architecture x86_64:
"_AVCaptureSessionPreset1280x720", referenced from:
___cxx_global_var_init in libwebrtc_full.a(device_info.o)
+[DeviceInfoIosObjC capabilityForPreset:] in libwebrtc_full.a(device_info_objc.o)
-[RTCVideoCaptureIosObjC startCaptureWithCapability:] in libwebrtc_full.a(rtc_video_capture_objc.o)
-[RTCVideoCaptureIosObjC startCaptureInBackgroundWithOutput:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"_AVCaptureSessionPreset352x288", referenced from:
___cxx_global_var_init in libwebrtc_full.a(device_info.o)
+[DeviceInfoIosObjC capabilityForPreset:] in libwebrtc_full.a(device_info_objc.o)
-[RTCVideoCaptureIosObjC startCaptureWithCapability:] in libwebrtc_full.a(rtc_video_capture_objc.o)
-[RTCVideoCaptureIosObjC startCaptureInBackgroundWithOutput:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"_AVCaptureSessionPreset640x480", referenced from:
___cxx_global_var_init in libwebrtc_full.a(device_info.o)
+[DeviceInfoIosObjC capabilityForPreset:] in libwebrtc_full.a(device_info_objc.o)
-[RTCVideoCaptureIosObjC startCaptureWithCapability:] in libwebrtc_full.a(rtc_video_capture_objc.o)
-[RTCVideoCaptureIosObjC startCaptureInBackgroundWithOutput:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"_AVCaptureSessionPresetLow", referenced from:
-[RTCVideoCaptureIosObjC startCaptureInBackgroundWithOutput:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"_AVMediaTypeVideo", referenced from:
+[DeviceInfoIosObjC captureDeviceCount] in libwebrtc_full.a(device_info_objc.o)
+[DeviceInfoIosObjC captureDeviceForIndex:] in libwebrtc_full.a(device_info_objc.o)
+[DeviceInfoIosObjC captureDeviceForUniqueId:] in libwebrtc_full.a(device_info_objc.o)
-[RTCVideoCaptureIosObjC startCaptureInBackgroundWithOutput:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"_CMSampleBufferGetImageBuffer", referenced from:
-[RTCVideoCaptureIosObjC captureOutput:didOutputSampleBuffer:fromConnection:] in libwebrtc_full.a(rtc_video_capture_objc.o)
"OBJC_CLASS$_AVCaptureDevice", referenced from:
objc-class-ref in libwebrtc_full.a(device_info_objc.o)
"OBJC_CLASS$_AVCaptureDeviceInput", referenced from:
objc-class-ref in libwebrtc_full.a(rtc_video_capture_objc.o)
"OBJC_CLASS$_AVCaptureSession", referenced from:
objc-class-ref in libwebrtc_full.a(rtc_video_capture_objc.o)
"OBJC_CLASS$_AVCaptureVideoDataOutput", referenced from:
objc-class-ref in libwebrtc_full.a(rtc_video_capture_objc.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I missing some Mac foundation packages here?

Thanks,
Alex

Hi,
Yes that may be the case, based on the references listed, should we try adding:

  • AVFoundation
  • CoreMedia

i.e. -framework AVFoundation -framework CoreMedia to the compile line

Great, thank you so much!!
I got stuck with this a year back on a different project; never thought about linking AVFoundation and CoreMedia.

So appending the arguments you suggested to line 20 in run_tests.sh did the trick:
clang++ -o simple_app $DIR/simple_app.cc -DWEBRTC_POSIX -DWEBRTC_MAC -I$WEBRTCBUILDS_FOLDER/include -std=c++11 -stdlib=libc++ $WEBRTCBUILDS_FOLDER/lib/$CONFIG/libwebrtc_full.a -framework Cocoa -framework Foundation -framework IOKit -framework Security -framework SystemConfiguration -framework ApplicationServices -framework CoreServices -framework CoreVideo -framework CoreAudio -framework AudioToolbox -framework QTKit -framework AVFoundation -framework CoreMedia