Menu

JPen v2.0.0 build issues on macOS 10.12

2016-12-01
2016-12-27
  • Hannes E. Schäuble

    Hello!

    I'm trying to build JPen v2.0.0 on macOS 10.12.1 (Sierra), but i get a build failure (output pasted at the end of the post)

    I'm used to write in Java, but i'm completely new to xcode and C
    I guess it's due to deprecation of Event-Type names and could be fixed by fitting replacements.

    If you could give me help setting up the xcode project or xcode build instructions
    and how to integrate the new native version into the maven repo
    (maybe it would be necessary to provide alternative versions for compatibility with older OS X versions)
    i could try fixing it...

    Best regards,
    Hannes E. Schäuble

    --- nar-maven-plugin:3.2.3:nar-compile (default-nar-compile) @ jpen ---
    Compiling 4 native files
    Warning: clang cannot dynamically link libgcc
    Warning: clang cannot dynamically link libgcc
    4 total files to be compiled.
    4 total files to be compiled.
    Found 4 processors available
    Found 4 processors available

    Starting Core 0 with 1 source files...

    Starting Core 0 with 1 source files...

    Starting Core 1 with 1 source files...

    Starting Core 1 with 1 source files...

    Starting Core 2 with 1 source files...

    Starting Core 2 with 1 source files...

    Starting Core 3 with 1 source files...

    Starting Core 3 with 1 source files...
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/NSDate_Additions.m:58:5: warning: 'Gestalt' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
    Gestalt( gestaltSystemVersion, &sysVersion );
    ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
    Gestalt(
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/NSDate_Additions.m:58:14: warning: 'gestaltSystemVersion' is deprecated: first deprecated in macOS 10.8 - Use NSProcessInfo's operatingSystemVersion property instead. [-Wdeprecated-declarations]
    Gestalt( gestaltSystemVersion, &sysVersion );
    ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:2076:3: note: 'gestaltSystemVersion' has been explicitly marked deprecated here
    gestaltSystemVersion = 'sysv', / system version/
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/NSDate_Additions.m:78:5: warning: 'Gestalt' is deprecated: first deprecated in macOS 10.8 [-Wdeprecated-declarations]
    Gestalt( gestaltSystemVersion, &sysVersion );
    ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:123:1: note: 'Gestalt' has been explicitly marked deprecated here
    Gestalt(
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/NSDate_Additions.m:78:14: warning: 'gestaltSystemVersion' is deprecated: first deprecated in macOS 10.8 - Use NSProcessInfo's operatingSystemVersion property instead. [-Wdeprecated-declarations]
    Gestalt( gestaltSystemVersion, &sysVersion );
    ^
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Gestalt.h:2076:3: note: 'gestaltSystemVersion' has been explicitly marked deprecated here
    gestaltSystemVersion = 'sysv', / system version/
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/NSDate_Additions.m:75:20: warning: unused variable 'interval' [-Wunused-variable]
    NSTimeInterval interval;
    ^
    5 warnings generated.
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/WacomAccess.m:71:8: warning: implicit declaration of function 'AESend' is invalid in C99 [-Wimplicit-function-declaration]
    err = AESend(&aeSend, // The complete AE we created above
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/WacomAccess.m:71:8: warning: implicit conversion loses integer precision: 'int' to 'OSErr' (aka 'short') [-Wconversion]
    err = AESend(&aeSend, // The complete AE we created above
    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2 warnings generated.
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:201:10: warning: 'NSTabletProximity' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSTabletProximity:
    ^~~~~~~~~~~~~~~~~
    NSEventTypeTabletProximity
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:84:26: note: 'NSTabletProximity' has been explicitly marked deprecated here
    static const NSEventType NSTabletProximity API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletProximity", macosx(10.0, 10.12)) = NSEventTypeTabletProximity;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:206:10: warning: 'NSScrollWheel' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSScrollWheel:
    ^~~~~~~~~~~~~
    NSEventTypeScrollWheel
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:82:26: note: 'NSScrollWheel' has been explicitly marked deprecated here
    static const NSEventType NSScrollWheel API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeScrollWheel", macosx(10.0, 10.12)) = NSEventTypeScrollWheel;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:222:41: warning: instance method '-_eventRef' not found (return type defaults to 'id'); did you mean '-eventRef'? [-Wobjc-method-access]
    EventRef theCarbonEvent = [event _eventRef];
    ^~~~~~~~~
    eventRef
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:317:12: note: receiver is instance of class declared here
    @interface NSEvent : NSObject <NSCopying, NSCoding=""> {
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:222:17: warning: incompatible pointer types initializing 'EventRef' (aka 'struct OpaqueEventRef *') with an expression of type 'id' [-Wincompatible-pointer-types]
    EventRef theCarbonEvent = [event _eventRef];
    ^ ~~~~~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:226:20: warning: instance method '-deviceDeltaX' not found (return type defaults to 'id') [-Wobjc-method-access]
    dx = [event deviceDeltaX];
    ^~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:317:12: note: receiver is instance of class declared here
    @interface NSEvent : NSObject <NSCopying, NSCoding=""> {
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:226:11: error: assigning to 'float' from incompatible type 'id'
    dx = [event deviceDeltaX];
    ^ ~~~~~~~~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:227:20: warning: instance method '-deviceDeltaY' not found (return type defaults to 'id') [-Wobjc-method-access]
    dy = [event deviceDeltaY];
    ^~~~~~~~~~~~
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:317:12: note: receiver is instance of class declared here
    @interface NSEvent : NSObject <NSCopying, NSCoding=""> {
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:227:11: error: assigning to 'float' from incompatible type 'id'
    dy = [event deviceDeltaY];
    ^ ~~~~~~~~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:229:13: warning: implicit conversion loses floating-point precision: 'CGFloat' (aka 'double') to 'float' [-Wconversion]
    dx = [event deltaX];
    ~ ^~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:230:13: warning: implicit conversion loses floating-point precision: 'CGFloat' (aka 'double') to 'float' [-Wconversion]
    dy = [event deltaY];
    ~ ^~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:249:30: warning: implicit conversion loses floating-point precision: 'CGFloat' (aka 'double') to 'float' [-Wconversion]
    float magnification = [event magnification];
    ~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:265:18: warning: implicit conversion loses floating-point precision: 'CGFloat' (aka 'double') to 'float' [-Wconversion]
    float dx = [event deltaX];
    ~~ ^~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:266:18: warning: implicit conversion loses floating-point precision: 'CGFloat' (aka 'double') to 'float' [-Wconversion]
    float dy = [event deltaY];
    ~~ ^~~~~~~~~~~~~~
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:302:10: warning: 'NSMouseMoved' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSMouseMoved:
    ^~~~~~~~~~~~
    NSEventTypeMouseMoved
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:69:26: note: 'NSMouseMoved' has been explicitly marked deprecated here
    static const NSEventType NSMouseMoved API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeMouseMoved", macosx(10.0, 10.12)) = NSEventTypeMouseMoved;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:303:10: warning: 'NSLeftMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSLeftMouseDown:
    ^~~~~~~~~~~~~~~
    NSEventTypeLeftMouseDown
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:65:26: note: 'NSLeftMouseDown' has been explicitly marked deprecated here
    static const NSEventType NSLeftMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDown", macosx(10.0, 10.12)) = NSEventTypeLeftMouseDown;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:304:10: warning: 'NSLeftMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSLeftMouseUp:
    ^~~~~~~~~~~~~
    NSEventTypeLeftMouseUp
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:66:26: note: 'NSLeftMouseUp' has been explicitly marked deprecated here
    static const NSEventType NSLeftMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseUp", macosx(10.0, 10.12)) = NSEventTypeLeftMouseUp;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:305:10: warning: 'NSLeftMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSLeftMouseDragged:
    ^~~~~~~~~~~~~~~~~~
    NSEventTypeLeftMouseDragged
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:70:26: note: 'NSLeftMouseDragged' has been explicitly marked deprecated here
    static const NSEventType NSLeftMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeLeftMouseDragged", macosx(10.0, 10.12)) = NSEventTypeLeftMouseDragged;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:306:10: warning: 'NSRightMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSRightMouseDown:
    ^~~~~~~~~~~~~~~~
    NSEventTypeRightMouseDown
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:67:26: note: 'NSRightMouseDown' has been explicitly marked deprecated here
    static const NSEventType NSRightMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDown", macosx(10.0, 10.12)) = NSEventTypeRightMouseDown;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:307:10: warning: 'NSRightMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSRightMouseUp:
    ^~~~~~~~~~~~~~
    NSEventTypeRightMouseUp
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:68:26: note: 'NSRightMouseUp' has been explicitly marked deprecated here
    static const NSEventType NSRightMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseUp", macosx(10.0, 10.12)) = NSEventTypeRightMouseUp;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:308:10: warning: 'NSRightMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSRightMouseDragged:
    ^~~~~~~~~~~~~~~~~~~
    NSEventTypeRightMouseDragged
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:71:26: note: 'NSRightMouseDragged' has been explicitly marked deprecated here
    static const NSEventType NSRightMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeRightMouseDragged", macosx(10.0, 10.12)) = NSEventTypeRightMouseDragged;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:309:10: warning: 'NSOtherMouseDown' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSOtherMouseDown:
    ^~~~~~~~~~~~~~~~
    NSEventTypeOtherMouseDown
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:85:26: note: 'NSOtherMouseDown' has been explicitly marked deprecated here
    static const NSEventType NSOtherMouseDown API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDown", macosx(10.0, 10.12)) = NSEventTypeOtherMouseDown;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:310:10: warning: 'NSOtherMouseUp' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSOtherMouseUp:
    ^~~~~~~~~~~~~~
    NSEventTypeOtherMouseUp
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:86:26: note: 'NSOtherMouseUp' has been explicitly marked deprecated here
    static const NSEventType NSOtherMouseUp API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseUp", macosx(10.0, 10.12)) = NSEventTypeOtherMouseUp;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:311:10: warning: 'NSOtherMouseDragged' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSOtherMouseDragged:
    ^~~~~~~~~~~~~~~~~~~
    NSEventTypeOtherMouseDragged
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:87:26: note: 'NSOtherMouseDragged' has been explicitly marked deprecated here
    static const NSEventType NSOtherMouseDragged API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeOtherMouseDragged", macosx(10.0, 10.12)) = NSEventTypeOtherMouseDragged;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:312:10: warning: 'NSTabletPoint' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    case NSTabletPoint:
    ^~~~~~~~~~~~~
    NSEventTypeTabletPoint
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:83:26: note: 'NSTabletPoint' has been explicitly marked deprecated here
    static const NSEventType NSTabletPoint API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletPoint", macosx(10.0, 10.12)) = NSEventTypeTabletPoint;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:315:21: warning: 'NSTabletPoint' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    bool tablet = NSTabletPoint == [event type] || NSTabletPointEventSubtype == [event subtype];
    ^~~~~~~~~~~~~
    NSEventTypeTabletPoint
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:83:26: note: 'NSTabletPoint' has been explicitly marked deprecated here
    static const NSEventType NSTabletPoint API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletPoint", macosx(10.0, 10.12)) = NSEventTypeTabletPoint;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:315:54: warning: 'NSTabletPointEventSubtype' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    bool tablet = NSTabletPoint == [event type] || NSTabletPointEventSubtype == [event subtype];
    ^~~~~~~~~~~~~~~~~~~~~~~~~
    NSEventSubtypeTabletPoint
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:262:29: note: 'NSTabletPointEventSubtype' has been explicitly marked deprecated here
    static const NSEventSubtype NSTabletPointEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletPoint", macosx(10.0, 10.12)) = NSEventSubtypeTabletPoint;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:318:11: warning: 'NSTabletPoint' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    if (NSTabletPoint != [event type] && [event subtype] == NSTabletProximityEventSubtype) {
    ^~~~~~~~~~~~~
    NSEventTypeTabletPoint
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:83:26: note: 'NSTabletPoint' has been explicitly marked deprecated here
    static const NSEventType NSTabletPoint API_DEPRECATED_WITH_REPLACEMENT("NSEventTypeTabletPoint", macosx(10.0, 10.12)) = NSEventTypeTabletPoint;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:318:63: warning: 'NSTabletProximityEventSubtype' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
    if (NSTabletPoint != [event type] && [event subtype] == NSTabletProximityEventSubtype) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    NSEventSubtypeTabletProximity
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:263:29: note: 'NSTabletProximityEventSubtype' has been explicitly marked deprecated here
    static const NSEventSubtype NSTabletProximityEventSubtype API_DEPRECATED_WITH_REPLACEMENT("NSEventSubtypeTabletProximity", macosx(10.0, 10.12)) = NSEventSubtypeTabletProximity;
    ^
    /Users/hannes/Programmierung/version-control/git/hosts/github.com/edgar79/jpen/src/main/c/osx/osx_push_provider.m:200:13: warning: 14 enumeration values not handled in switch: 'NSEventTypeMouseEntered', 'NSEventTypeMouseExited', 'NSEventTypeKeyDown'... [-Wswitch]
    switch ( [event type] ) {
    ^
    27 warnings and 2 errors generated.


    BUILD FAILURE

     
  • Hannes E. Schäuble

    Hello

    i got it fixed in xcode (it compiles in xcode so far, untested):

    In the file osx_push_provider.m, method implementation of JPen_sendEvent, case NSScrollWheel:

    // inspiration from https://dxr.mozilla.org/mozilla-b2g28_v1_3/source/widget/cocoa/nsChildView.mm
    
                            if ([event respondsToSelector:@selector(scrollingDeltaX)]) { // Available since macOS 10.7
                                dx = [event scrollingDeltaX];
                                dy = [event scrollingDeltaY];
                                useDeviceDelta=true;
                            } else {
                                dx = [event deltaX];
                                dy = [event deltaY];
                            }
    

    But i do not know if the old workaround (getting the CarbonEvent) is still necessary
    or if it is still possible:

    if ([event respondsToSelector:@selector(_eventRef)] &&
    //xcode: undeclared selector _eventRef
                                [event respondsToSelector:@selector(deviceDeltaX)]) {
                                //xcode: undeclared selector deviceDeltaX
                                EventRef theCarbonEvent = [event _eventRef];
                                //xcode: _eventRef not found defaults to 'id'
                                useDeviceDelta = theCarbonEvent && GetEventKind(theCarbonEvent) == kEventMouseScroll;
                            }
    
     
  • Hannes E. Schäuble

    Hello Nicolas

    as mentioned in the post before i got it to compile successfully in xcode with SDK 10.12
    but i do not know how to maintain backwards compatibility (and i am completely new to xcode and c).

    I can set the "developement target" to 10.6 or 10.7
    and event scrollingDeltaX/Y is available since SDK 10.7+
    but i can't compile source using deviceDeltaX/Y

    Probably there would be a solution using precompiler macros, but as i do not know how to do it ( and as there are several deprecation warnings for SDK 10.12 ) i made a first approach based on the idea of providing an alternative jnilib (with another version number)...

    So i coded the following changes:

    • introduced jpen.provider.macOS.nativeVersion and nativeBuild in build.properties to distinguish versions

    • made CocoaProvider.java select the Library to load (osx.nativeVersion or macOS.nativeVersion) based on System.getProperty("os.version")

    • copied src/main/c/osx/... to src/main/c/macOS/

    • manually added src/main/c/nativeBuild/macOS-BuildNumber.h

    • added a profile macOS in pom.xml using source.dir src/main/c/macOS

    • started coding in xcode using src/main/c/macOS/...

    So far it builds in xcode and successfully compiles using maven,
    but: when i use maven i get a linker error:
    ld: symbol(s) not found for architecture x86_64
    (from nearly every generated .o file)

    I do not know how to resolve the linker error and can't test the resulting maven-build...

    Best regards
    Hannes

    EDIT: added x to "builds in xcode"

     

    Last edit: Hannes E. Schäuble 2016-12-11
  • Hannes E. Schäuble