Open mnoga23 opened 5 years ago
That's odd.
The compiler should know that "wnd" is an NSWindow and the return value of convertPointToScreen is an NSPoint.
Are there any other error and/or warning messages before that?
https://github.com/joncampbell123/dosbox-x/blob/master/src/gui/menu_osx.mm#L508
The compiler in Mac OS X for some reason treats unknown types as an "id" apparently.
Thanks for responding, there are some warnings before that. Full log here: https://pastebin.com/xnwhgq9s For some reason github errors on attachments for me.
The compiler is wrong,
https://developer.apple.com/documentation/appkit/nswindow/2967182-convertpointtoscreen?language=objc
menu_osx.mm:508:27: warning: instance method '-convertPointToScreen:' not found (return type defaults to 'id') [-Wobjc-method-access] NSPoint pt = [wnd convertPointToScreen:NSMakePoint(rct.size.width / 2, rct.size.height / 2)];
Unless XCode changed suddenly from a few months ago, that instance method should be valid.
I'll pull out the macbook tonight to see if I get the same error.
Perhaps if I ask OS X to update XCode I'll get the same error.
just to document it; i am using these versions: xcodebuild -version Xcode 10.1 Build version 10B61
xcodebuild -showsdks
iOS SDKs:
iOS 12.1 -sdk iphoneos12.1
iOS Simulator SDKs: Simulator - iOS 12.1 -sdk iphonesimulator12.1
macOS SDKs: macOS 10.14 -sdk macosx10.14
tvOS SDKs: tvOS 12.1 -sdk appletvos12.1
tvOS Simulator SDKs: Simulator - tvOS 12.1 -sdk appletvsimulator12.1
watchOS SDKs: watchOS 5.1 -sdk watchos5.1
watchOS Simulator SDKs: Simulator - watchOS 5.1 -sdk watchsimulator5.1
I must be setting up my machine wrong; because i just compiled dosbox master fine on another macbook with Mojave and 10.14 sdk and xcode 10.1. weird if you have any idea what to check on the other one I will appreciate the information.
We (Homebrew) are also seeing this on our CI machines: https://github.com/Homebrew/homebrew-core/pull/38411 on macOS Sierra with Xcode 9.2
Not sure why this might have happened in Mojave for @mnoga23 , but it sounds a bit like convertPointToScreen
was actually added in Mojave, and not in Sierra. That might explain why @fxcoudert is running into the issue when building for Sierra.
This happens to fix issue 1518 because it turns out that contrary to the annotation in the 10.14 NSWindow.h, convertPointToScreen and convertPointFromScreen originate in 10.14, not 10.12.
Nice. In addition to the sparse and sometimes unhelpful documentation for their API, they also can't get the minimum version numbers right either :(
Please try the latest commit, see if it helps.
@joncampbell123 Pulled and compiled. Works for me on High Sierra (10.13.6).
How do you guys build it on a mac? Running ./build-macosx just stops abrubtly:
menu_osx.mm:508:17: error: no viable conversion from 'id' to 'NSPoint' (aka 'CGPoint') NSPoint pt = [wnd convertPointToScreen:NSMakePoint(rct.size.width / 2, rct.size.height / 2)]; ^
~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:20:1: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'id' to 'const CGPoint &' for 1st argument CGPoint { ^ /System/Library/Frameworks/CoreGraphics.framework/Headers/CGGeometry.h:20:1: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'id' to 'CGPoint &&' for 1st argument 1 warning and 1 error generated. make[3]: [menu_osx.o] Error 1 make[3]: Waiting for unfinished jobs.... make[2]: [all-recursive] Error 1 make[1]: [all-recursive] Error 1 make: *** [all] Error 2Tried High Sierra and Mojave builds with latest XCode.