Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't Run Example on MacOS 10.13.6 #1125

Closed
LazyInn opened this issue Mar 31, 2020 · 13 comments
Closed

Can't Run Example on MacOS 10.13.6 #1125

LazyInn opened this issue Mar 31, 2020 · 13 comments

Comments

@LazyInn
Copy link

LazyInn commented Mar 31, 2020

I'm running into a problem running the rotate example with go version go1.14.1 darwin/amd64 on MacOS 10.13.6. It runs fine on a different machine running 10.14.x.

go run -tags=example github.com/hajimehoshi/ebiten/examples/rotate
# github.com/hajimehoshi/ebiten/internal/graphicsdriver/metal/mtl
In file included from mtl.m:18:
In file included from /System/Library/Frameworks/Metal.framework/Headers/Metal.h:9:
In file included from /System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h:8:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:14:
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /Library/Frameworks/AE.framework/Headers/AE.h:29:
/Library/Frameworks/AE.framework/Headers/AppleEvents.h:597:165: error: expected function body after function declarator
/usr/include/Availability.h:216:50: note: expanded from macro '__OSX_AVAILABLE_STARTING'
<scratch space>:87:1: note: expanded from here
# github.com/hajimehoshi/ebiten/internal/devicescale
In file included from ../../go/pkg/mod/github.com/hajimehoshi/[email protected]/internal/devicescale/impl_mac.go:24:
In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:10:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:87:
In file included from /System/Library/Frameworks/Foundation.framework/Headers/NSURLError.h:14:
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /Library/Frameworks/AE.framework/Headers/AE.h:29:
/Library/Frameworks/AE.framework/Headers/AppleEvents.h:597:165: error: expected function body after function declarator
extern OSStatus AEDeterminePermissionToAutomateTarget( const AEAddressDesc* target, AEEventClass theAEEventClass, AEEventID theAEEventID, Boolean askUserIfNeeded ) __OSX_AVAILABLE_STARTING( __MAC_10_14, __IPHONE_NA );
                                                                                                                                                                    ^
/usr/include/Availability.h:216:50: note: expanded from macro '__OSX_AVAILABLE_STARTING'
    #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
                                                 ^
<scratch space>:84:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_14
^
1 error generated.
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../../go/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/native_darwin.go:7:
In file included from ./glfw/include/GLFW/glfw3native.h:90:
In file included from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:23:
In file included from /Library/Frameworks/AE.framework/Headers/AE.h:29:
/Library/Frameworks/AE.framework/Headers/AppleEvents.h:597:165: error: expected function body after function declarator
extern OSStatus AEDeterminePermissionToAutomateTarget( const AEAddressDesc* target, AEEventClass theAEEventClass, AEEventID theAEEventID, Boolean askUserIfNeeded ) __OSX_AVAILABLE_STARTING( __MAC_10_14, __IPHONE_NA );
                                                                                                                                                                    ^
/usr/include/Availability.h:216:50: note: expanded from macro '__OSX_AVAILABLE_STARTING'
    #define __OSX_AVAILABLE_STARTING(_osx, _ios) __AVAILABILITY_INTERNAL##_osx
                                                 ^
<scratch space>:58:1: note: expanded from here
__AVAILABILITY_INTERNAL__MAC_10_14
^
1 error generated.
@hajimehoshi
Copy link
Owner

Hi, which version of Ebiten are you using?

This error indicates you'd need to use macOS 10.14 or later, but in theory Ebiten should work with older macOS.

@LazyInn
Copy link
Author

LazyInn commented Mar 31, 2020

I see v1.10.5 listed in ~/go/pkg/mod/github.com/hajimehoshi/

@hajimehoshi
Copy link
Owner

Thanks.

Are you using the latest Xcode and its tools?

@LazyInn
Copy link
Author

LazyInn commented Mar 31, 2020

I've got Xcode 10.1 installed, build 10B61, that's the latest that runs on 10.13.x I think.

@hajimehoshi
Copy link
Owner

Thanks. Hmm, you can use Ebiten 1.11.0-rc.1, which uses GLFW 3.3 instead of 3.2, but I don't think this would solve this issue. Then, you might need to update macOS to 10.14 or later. Sorry I could not give a good help.

@LazyInn
Copy link
Author

LazyInn commented Mar 31, 2020

Ah that sucks but I guess I can't hold out forever. Thanks anyway for trying!

@hajimehoshi
Copy link
Owner

I'll notify you here when I find another solution. Thank you!

@einthusan
Copy link

I have a Mac OSX 10.11.6 and all the examples work properly. Sorry to hijack this thread @hajimehoshi but although everything works perfectly fine, I am indeed getting these warnings.

# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
ca.m:66:11: warning: instance method '-setMaximumDrawableCount:' not found (return type defaults to 'id') [-Wobjc-method-access]
/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:44:12: note: receiver is instance of class declared here
ca.m:85:35: warning: instance method '-setDisplaySyncEnabled:' not found (return type defaults to 'id') [-Wobjc-method-access]
/System/Library/Frameworks/QuartzCore.framework/Headers/CAMetalLayer.h:44:12: note: receiver is instance of class declared here
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/ca
warning: unknown warning option '-Wno-unguarded-availability-new'; did you mean '-Wno-partial-availability'? [-Wunknown-warning-option]
# command-line-arguments
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000014.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000015.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000016.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000017.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000018.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000037.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000038.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000039.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000040.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000041.o) was built for newer OSX version (10.12) than being linked (10.11)
ld: warning: object file (/var/folders/cj/ymv0b8js49l90hc7v5txjqg80000gn/T/go-link-879478339/000042.o) was built for newer OSX version (10.12) than being linked (10.11)

I been on the Golang threads as well, regarding this. They seem to have closed the issue. I tried their suggestion of CGO_FLAGS=-mmacosx-version-min=10.11 but exact same errors happen. I do know the flag works because if I change it to 10.12 (just to test it) then Ebiten breaks completely and wont even build. Any suggestions on why this might be?

@hajimehoshi
Copy link
Owner

I do know the flag works because if I change it to 10.12 (just to test it) then Ebiten breaks completely and wont even build. Any suggestions on why this might be?

What kind of error did you see?

@einthusan
Copy link

einthusan commented Jan 6, 2021

No errors, just warnings. However, as you mentioned in Slack, by using go build -tags=ebitengl main.go which bypasses Metal and uses OpenGL ES (i believe) .. the warnings have disappeared. Thanks!

golang/go#43546

@weberc2-tempus
Copy link

I'm getting a related error when I try to run the example with go1.15 and macOS 10.15.3:

# github.com/hajimehoshi/ebiten/v2/internal/devicescale
../../go/pkg/mod/github.com/hajimehoshi/ebiten/[email protected]/internal/devicescale/impl_mac.go:23:10: fatal error: 'AppKit/AppKit.h' file not found
 #import <AppKit/AppKit.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
# github.com/go-gl/glfw/v3.3/glfw
In file included from ../../go/pkg/mod/github.com/go-gl/glfw/v3.3/[email protected]/c_glfw.go:4:
In file included from ./glfw/src/context.c:30:
In file included from ./glfw/src/internal.h:184:
./glfw/src/cocoa_platform.h:30:10: fatal error: 'Carbon/Carbon.h' file not found
#include <Carbon/Carbon.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/metal/mtl
mtl.m:18:9: fatal error: 'Metal/Metal.h' file not found
# github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver/opengl/gl
ld: framework not found OpenGL
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

@hajimehoshi
Copy link
Owner

This also sounds like an issue in go-gl/glfw. CC @dmitshur

@dmitshur
Copy link

Maybe, but "fatal error: 'Carbon/Carbon.h' file not found" sounds like a system issue; that file should definitely exist with a properly installed Xcode (or Xcode CLI). If it can be reproduced, please file an issue in the go-gl/glfw issue tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants