Error compiling Qt5 using qt-easy-build/Build-qt.sh script

@jcfr
I’m attempting to build Qt5.10.0 using the qt-easy-build/Build-qt.sh script to deal with the rpath issue with packaging Slicer on Mac, but it fails. Help?
Operating system is MacOS 10.12. Xcode 9.2
The Xcode installation doesn’t have the 10.12 sdk, it has 10.13.

Command line: ./Build-qt.sh -d 10.12 -s macosx10.13 -j 4

Error:

compiling qwebview_darwin.mm
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_AVAILABLE(macosx…
^
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[3]: *** [.obj/qwebview_darwin.o] Error 1
make[2]: *** [sub-webview-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make: *** [module-qtwebview-make_first] Error 2

Thanks for any assistance.

That’s supposed to be fixed in 5.10.1, see: https://bugreports.qt.io/browse/QTBUG-65075
5.10.1 should be a clean upgrade in qt-easy-build, just change the version and the MD5 sum.

(or, alternatively and less than ideal: remove -Werror in the compiler command line options actually, that’s buried in the qt build scripts, which are fairly confusing. It will probably be much easier to upgrade the version)

1 Like

Ok, thanks. Has it been tested for 5.11?

Slicer is known to build against 5.11, as that’s the recommendation on Linux. I don’t know if qt-easy-build has been tested against 5.11.

1 Like

Ok, 5.11.1 didn’t compile. I’ll try 5.10.1.
The error:

In file included from main.cpp:19:
In file included from …/…/3rdparty/chromium/base/at_exit.h:9:
In file included from …/…/3rdparty/chromium/base/callback.h:9:
In file included from …/…/3rdparty/chromium/base/callback_internal.h:14:
…/…/3rdparty/chromium/base/memory/ref_counted.h:155:5: warning: use of this statement in a constexpr constructor is a C++14
extension [-Wc++14-extensions]
needs_adopt_ref_ = true;
^
linking …/…/lib/QtWebEngineCore.framework/Versions/5/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess
In file included from main.cpp:20:
In file included from …/…/3rdparty/chromium/base/files/file_path.h:115:
…/…/3rdparty/chromium/base/strings/string_piece.h:226:18: warning: ‘constexpr’ non-static member function will not be
implicitly ‘const’ in C++14; add ‘const’ to avoid a change in behavior [-Wconstexpr-not-const]
constexpr void remove_prefix(size_type n) {
^
const
…/…/3rdparty/chromium/base/strings/string_piece.h:231:18: warning: ‘constexpr’ non-static member function will not be
implicitly ‘const’ in C++14; add ‘const’ to avoid a change in behavior [-Wconstexpr-not-const]
constexpr void remove_suffix(size_type n) { length_ -= n; }
^
const
…/…/3rdparty/chromium/base/strings/string_piece.h:226:18: error: constexpr function’s return type ‘void’ is not a literal
type
constexpr void remove_prefix(size_type n) {
^
…/…/3rdparty/chromium/base/strings/string_piece.h:231:18: error: constexpr function’s return type ‘void’ is not a literal
type
constexpr void remove_suffix(size_type n) { length_ -= n; }
^
compiling …/…/include/QtWebEngine/QtWebEngineDepends
143 warnings and 7 errors generated.
make[3]: *** [.obj/main.o] Error 1
make[2]: *** [sub-tools-qwebengine_convert_dict-make_first] Error 2

Qt 5.10.1 compiled successfully using the script.
For reference, the MD5sum for Qt 5.10.1 is 7e167b9617e7bd64012daaacb85477af

Thanks!

1 Like

Thanks @mschumaker

Could you submit a PR to update https://github.com/jcfr/qt-easy-build/tree/5.10.0 ?

1 Like