sourcey / libsourcey

C++14 evented IO libraries for high performance networking and media based applications
https://sourcey.com/libsourcey
GNU Lesser General Public License v2.1
1.31k stars 347 forks source link

Compilation error on OSX #240

Open mmallad opened 6 years ago

mmallad commented 6 years ago

I got following error while compiling libsourcey on OSX(10.13.4). typedef redefinition with different types ('NSString *' vs 'AVMediaType')

robamaton commented 6 years ago

@mmallad were you able to find a solution? I'm encountering this as well. Thanks!

In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:34:
/System/Library/Frameworks/AVFoundation.framework/Headers/AVAssetWriter.h:135:41: error: type argument 'AVMediaType' is neither an Objective-C object nor a block type
@property (nonatomic, readonly) NSArray<AVMediaType> *availableMediaTypes;
                                        ^~~~~~~~~~~
In file included from /Users/joel/Code/libsourcey/src/av/src/apple/avfoundation.mm:10:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:46:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDataOutputSynchronizer.h:9:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutput.h:11:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureAudioDataOutput.h:9:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureOutputBase.h:12:
In file included from /System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureSession.h:10:
/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:521:102: error: nullability specifier 'nullable' cannot be applied to non-pointer type 'AVMediaType'
+ (nullable AVCaptureDevice *)defaultDeviceWithDeviceType:(AVCaptureDeviceType)deviceType mediaType:(nullable AVMediaType)mediaType position:(AVCaptureDevicePosition)position NS_AVAILABLE_IOS(10_0) __TVOS_PROHIBITED;
                                                                                                     ^
/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:1715:104: error: nullability specifier 'nullable' cannot be applied to non-pointer type 'AVMediaType'
+ (instancetype)discoverySessionWithDeviceTypes:(NSArray<AVCaptureDeviceType> *)deviceTypes mediaType:(nullable AVMediaType)mediaType position:(AVCaptureDevicePosition)position;
                                                                                                       ^
3 warnings and 4 errors generated.
make[2]: *** [av/CMakeFiles/av.dir/src/apple/avfoundation.mm.o] Error 1
make[1]: *** [av/CMakeFiles/av.dir/all] Error 2
eloi-loomai commented 4 years ago

Any solution on that?