2017-12-18 8 views
1

Ich möchte die neue Version Qt5.10.0 aus der Quelle für mein MacOS mit der Version 10.12.6 (Sierra) erstellen.Fehler "qwebview_darwin.mm:261:24" am Gebäude qt 5.10.0 von Quelle für macOS 10.12.6

Diese Fehler am Ende des Build-Prozesses aufgetreten:

qwebview_darwin.mm:261:24: error: 
'loadFileURL:allowingReadAccessToURL:' is only available on macOS 10.11 
or newer 
[-Werror,-Wunguarded-availability] 
[wkWebView loadFileURL:url.toNSURL() 
        ^~~~~~~~~~~~~~~~~~~~~~~~~ 

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebView.h:102:1: 
note: 
'loadFileURL:allowingReadAccessToURL:' has been explicitly marked 
partial here 
- (nullable WKNavigation *)loadFileURL:(NSURL *)URL allowingReadAccessToURL:(NSURL *)readAccessURL API_AVAILAB... 
^ 
qwebview_darwin.mm:261:24: note: enclose 
'loadFileURL:allowingReadAccessToURL:' in an @available check to 
silence this warning 

[wkWebView loadFileURL:url.toNSURL() 


        ^~~~~~~~~~~~~~~~~~~~~~~~~ 

1 error generated. 
make[4]: *** [.obj/debug/qwebview_darwin.o] Error 1 
make[3]: *** [debug-install] Error 2 
make[2]: *** [sub-webview-install_subtargets] Error 2 
make[1]: *** [sub-src-install_subtargets] Error 2 
make: *** [module-qtwebview-install_subtargets] Error 2 

Vielleicht haben Sie ein paar Tricks haben diese Fehler zu behandeln. Wissen Sie, was ich tun muss? Und wie diese Fehler umgehen?

Antwort

0

den Anruf zu loadFileURL in einem @available Scheck beilegen, wie die folgenden

if (@available(macOS 10.11, *)) { 
    [wkWebView loadFileURL:url.toNSURL() allowingReadAccessToURL:QUrl(url.toString(QUrl::RemoveFilename)).toNSURL()]; 
} 
Verwandte Themen