我正在尝试使用gcc 5.3.0在OSX 10.10.5上构建Paraview。
在构建Vtk时,我得到:
[24%]构建CXX对象 VTK /渲染/ OpenGL的/ CMakeFiles / vtkRenderingOpenGL.dir / vtkCocoaRenderWindowInteractor.mm.o 在/usr/include/os/object.h:75:0中包含的文件中, 来自/usr/include/dispatch/dispatch.h:48, 来自/System/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:15, 来自/System/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:13, 来自/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:55, 来自/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6, 来自/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12, 来自/Users/Leo/projects/ParaView/VTK/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm:16: /usr/include/objc/NSObject.h:22:4:错误:'instancetype'没有命名 一种 - (instancetype)self; ^ /usr/include/objc/NSObject.h:36:4:错误:'instancetype'没有命名类型 - (instancetype)保留OBJC_ARC_UNAVAILABLE; ^ /usr/include/objc/NSObject.h:38:4:错误:'instancetype'没有命名类型 - (instancetype)autorelease OBJC_ARC_UNAVAILABLE; ^ /usr/include/objc/NSObject.h:60:4:错误:'instancetype'没有命名类型 - (instancetype)init; ^ /usr/include/objc/NSObject.h:62:4:错误:'instancetype'没有命名类型+(instancetype)new; ^ /usr/include/objc/NSObject.h:63:4:错误:'instancetype'没有命名类型+(instancetype)allocWithZone:(struct _NSZone *)zone; ^ /usr/include/objc/NSObject.h:64:4:错误:'instancetype'没有命名类型+(instancetype)alloc; ^在/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:0中包含的文件中, 来自/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12, 来自/Users/Leo/projects/ParaView/VTK/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm:16: /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:59:42: 错误:预期')'之前'('令牌 - (void)enumerateObjectsUsingBlock:(void(^)(id obj,NSUInteger idx,BOOL * stop))block NS_AVAILABLE(10_6,4_0); ^ /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:59:42: 错误:'('标记之前的预期标识符 /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:59:42: 错误:预期';'之前'('令牌 /System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:60:81: 错误:预期')'之前'('令牌 - (void)enumerateObjectsWithOptions:(NSEnumerationOptions)opts usingBlock:(void(^)(id obj,NSUInteger idx,BOOL * stop))block NS_AVAILABLE(10_6,4_0);
所有错误都来自OSX标头/System/Library/Frameworks/Foundation.framework/Headers/NS....h
我知道GCC无法识别Objective-C Block(^
)和here我发现GCC不理解instancetype
。
有没有办法在OSX上使用gcc构建Paraview,我应该停用Vtk吗?