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

**URL:** <https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610>\
**Category:** Development\
**Tags:** build\
**Created:** [July 30, 2018, 3:01pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610 "2018-07-30T15:01:32Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![mschumaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mschumaker/32/1395_2.png) [@mschumaker](https://discourse.slicer.org/u/mschumaker)\
**Post date:** [July 30, 2018, 3:01pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/1 "2018-07-30T15:01:32Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [July 30, 2018, 4:10pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/2 "2018-07-30T16:10:09Z")

</div>

That’s supposed to be fixed in 5.10.1, see: [https://bugreports.qt.io/browse/QTBUG-65075](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)

---

<div class="post-metadata">

**Author:** ![mschumaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mschumaker/32/1395_2.png) [@mschumaker](https://discourse.slicer.org/u/mschumaker)\
**Post date:** [July 30, 2018, 4:21pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/3 "2018-07-30T16:21:46Z")

</div>

Ok, thanks. Has it been tested for 5.11?

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ihnorton/32/9_2.png) [@ihnorton](https://discourse.slicer.org/u/ihnorton)\
**Post date:** [July 30, 2018, 5:56pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/4 "2018-07-30T17:56:42Z")

</div>

> [@mschumaker](#):
>
> Has it been tested for 5.11?

Slicer is known to build against 5.11, as that’s the [recommendation on Linux](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Linux). I don’t know if qt-easy-build has been tested against 5.11.

---

<div class="post-metadata">

**Author:** ![mschumaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mschumaker/32/1395_2.png) [@mschumaker](https://discourse.slicer.org/u/mschumaker)\
**Post date:** [July 30, 2018, 7:33pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/5 "2018-07-30T19:33:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mschumaker](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mschumaker/32/1395_2.png) [@mschumaker](https://discourse.slicer.org/u/mschumaker)\
**Post date:** [July 30, 2018, 9:51pm UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/6 "2018-07-30T21:51:48Z")

</div>

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

Thanks!

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [July 31, 2018, 3:05am UTC](https://discourse.slicer.org/t/error-compiling-qt5-using-qt-easy-build-build-qt-sh-script/3610/7 "2018-07-31T03:05:13Z")

</div>

Thanks @mschumaker

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