goreleaser-cross icon indicating copy to clipboard operation
goreleaser-cross copied to clipboard

Error: /Headers/NSBundle.h:91:143: error: function does not return NSString

Open iamkhalidbashir opened this issue 11 months ago • 1 comments

I am recieving this error when building a wails app with -tags=desktop,production

In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:9:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:91:143: error: function does not return NSString
- (NSAttributedString *)localizedAttributedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
                                                         ~~~~~~~~~~~~~~                                                                       ^                  ~
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro 'NS_FORMAT_ARGUMENT'
        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))
                                                      ^          ~
In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:9:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:130:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:168: error: expected ')'
- (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
                                                                                                                                                                       ^
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSURLSession.h:500:141: note: to match this '('
- (void)readDataOfMinLength:(NSUInteger)minBytes maxLength:(NSUInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
                                                                                                                                            ^
In file included from /root/go/pkg/mod/github.com/wailsapp/wails/[email protected]/pkg/assetserver/webview/request_darwin.go:10:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WebKit.h:39:
In file included from /usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKFrameInfo.h:30:
/usr/local/osxcross/bin/../SDK/MacOSX12.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h:337:237: error: unknown type name '_Nullable_result'
- (void)callAsyncJavaScript:(NSString *)functionBody arguments:(nullable NSDictionary<NSString *, id> *)arguments inFrame:(nullable WKFrameInfo *)frame inContentWorld:(WKContentWorld *)contentWorld completionHandler:(void (^ _Nullable)(_Nullable_result id, NSError * _Nullable error))completionHandler NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(11.0), ios(14.0));

When solutions I found is this:- https://github.com/tpoechtrager/osxcross/issues/345

Which requires me to set CXXFLAGS=-DNS_FORMAT_ARGUMENT(A)=

But how to set this flag?

iamkhalidbashir avatar Jul 30 '23 09:07 iamkhalidbashir