Can't configure Qt 5.12.0 with Qt for WebAssembly in Linux lubuntu
-
I've been trying to build qt from source and cross-compile for wasm using emscripten to get Qt for WebAssembly to compile. I've been following the steps from this blog post https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ and I keep getting stuck at the configure step. When I run:
$ ~/Qt/5.12.0/Src/configure -xplatform wasm-emscripten -nomake examples -prefix $PWD/qtbase
It results in this error:
Project ERROR: Cannot run target compiler 'em++'. Output:
===================
===================
Maybe you forgot to setup the environmentI've installed emscripten per the instructions from http://kripken.github.io/emscripten-site/docs/getting_started/index.html and em++ --version returns the correct version. I'm using version 1.38.16. Additionally I was able to compile their hello world test into html and run it off localhost in both firefox and google chrome. I've confirmed the em++ compiler is in my path.
Could anybody tell me what I'm missing?
-
Hi and welcome to devnet,
You should add the
-v
parameter to your configure call so you'll see directly what is failing. -
Because it already ran, you have to re-run configure from a clean state.
One recommendation: use out of source builds so you can just nuke the build folder and start over more easily.
-
No, you have to delete everything that was generated. Hence my recommendation of using an out of source build.
-
The output is really a bit thin to guess.
Did you call
source ./emsdk_env.sh
before calling configure ? -
Yes I did. And I managed to get through the configure step. It seems I just needed a clean slate. And this was the result:
Configure summary:
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2)
Building for: wasm-emscripten (wasm, CPU features: <none>)
Target compiler: clang 6.0.1
Configuration: cross_compile compile_examples largefile release c++11 c++14 c++1z no-pkg-config reduce_exports static stl
Build options:
Mode ................................... release
Optimize release build for size ........ no
Building shared libraries .............. no
Using C standard ....................... C11
Using C++ standard ..................... C++1z
Using ccache ........................... no
Using gold linker ...................... no
Using precompiled headers .............. no
Using LTCG ............................. no
Target compiler supports:
Build parts ............................ libs
Qt modules and options:
Qt Concurrent .......................... no
Qt D-Bus ............................... no
Qt D-Bus directly linked to libdbus .... no
Qt Gui ................................. yes
Qt Network ............................. yes
Qt Sql ................................. no
Qt Testlib ............................. yes
Qt Widgets ............................. yes
Qt Xml ................................. yes
Support enabled for:
Using pkg-config ....................... no
udev ................................... no
Using system zlib ...................... yes
Qt Core:
DoubleConversion ....................... yes
Using system DoubleConversion ........ no
GLib ................................... no
iconv .................................. yes
ICU .................................... no
Tracing backend ........................ <none>
Logging backends:
journald ............................. no
syslog ............................... no
slog2 ................................ no
Using system PCRE2 ..................... no
Qt Network:
getifaddrs() ........................... no
IPv6 ifname ............................ no
libproxy ............................... no
OpenSSL ................................ no
Qt directly linked to OpenSSL ........ no
OpenSSL 1.1 ............................ no
DTLS ................................... no
SCTP ................................... no
Use system proxies ..................... yes
Qt Gui:
Accessibility .......................... yes
FreeType ............................... yes
Using system FreeType ................ no
HarfBuzz ............................... yes
Using system HarfBuzz ................ no
Fontconfig ............................. no
Image formats:
GIF .................................. yes
ICO .................................. yes
JPEG ................................. yes
Using system libjpeg ............... no
PNG .................................. yes
Using system libpng ................ yes
EGL .................................... yes
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ no
OpenGL ES 3.1 ........................ no
OpenGL ES 3.2 ........................ no
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. no
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon-evdev ........................ no
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... no
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... no
LinuxFB ................................ no
VNC .................................... yes
Mir client ............................. no
Qt Sql:
SQL item models ........................ yes
Qt Widgets:
GTK+ ................................... no
Styles ................................. Fusion Windows
Qt PrintSupport:
CUPS ................................... no
Qt Sql Drivers:
DB2 (IBM) .............................. no
InterBase .............................. no
MySql .................................. no
OCI (Oracle) ........................... no
ODBC ................................... no
PostgreSQL ............................. no
SQLite2 ................................ no
SQLite ................................. yes
Using system provided SQLite ......... no
TDS (Sybase) ........................... no
Qt Testlib:
Tester for item models ................. yes
Qt SerialBus:
Socket CAN ............................. no
Socket CAN FD .......................... no
Qt QML:
QML network support .................... yes
QML debugging and profiling support .... yes
QML sequence object .................... yes
QML list model ......................... yes
QML XML http request ................... yes
QML Locale ............................. yes
QML delegate model ..................... yes
Qt Quick:
Direct3D 12 ............................ no
AnimatedImage item ..................... yes
Canvas item ............................ yes
Support for Qt Quick Designer .......... yes
Flipable item .......................... yes
GridView item .......................... yes
ListView item .......................... yes
TableView item ......................... yes
Path support ........................... yes
PathView item .......................... yes
Positioner items ....................... yes
Repeater item .......................... yes
ShaderEffect item ...................... yes
Sprite item ............................ yes
Qt Scxml:
ECMAScript data model for QtScxml ...... yes
Qt Gamepad:
SDL2 ................................... no
Qt 3D:
Assimp ................................. yes
System Assimp .......................... no
Output Qt3D Job traces ................. no
Output Qt3D GL traces .................. no
Use SSE2 instructions .................. no
Use AVX2 instructions .................. no
Aspects:
Render aspect ........................ yes
Input aspect ......................... yes
Logic aspect ......................... yes
Animation aspect ..................... yes
Extras aspect ........................ yes
Qt 3D Renderers:
OpenGL Renderer ........................ yes
Qt 3D GeometryLoaders:
Autodesk FBX ........................... no
Qt Wayland Client ........................ no
Qt Wayland Compositor .................... no
Qt Bluetooth:
BlueZ .................................. no
BlueZ Low Energy ....................... no
Linux Crypto API ....................... no
WinRT Bluetooth API (desktop & UWP) .... no
Qt Sensors:
sensorfw ............................... no
Qt Quick Controls 2:
Styles ................................. Default Fusion Imagine Material Universal
Qt Quick Templates 2:
Hover support .......................... yes
Multi-touch support .................... yes
Qt Positioning:
Gypsy GPS Daemon ....................... no
WinRT Geolocation API .................. no
Qt Location:
Qt.labs.location experimental QML plugin . yes
Geoservice plugins:
OpenStreetMap ........................ no
HERE ................................. yes
Esri ................................. yes
Mapbox ............................... yes
MapboxGL ............................. yes
Itemsoverlay ......................... yes
QtXmlPatterns:
XML schema support ..................... yes
Qt Multimedia:
ALSA ................................... no
GStreamer 1.0 .......................... no
GStreamer 0.10 ......................... no
Video for Linux ........................ no
OpenAL ................................. yes
PulseAudio ............................. no
Resource Policy (libresourceqt5) ....... no
Windows Audio Services ................. no
DirectShow ............................. no
Windows Media Foundation ............... no
Qt WebEngine:
Embedded build ......................... yes
Pepper Plugins ......................... no
Printing and PDF ....................... no
Proprietary Codecs ..................... no
Spellchecker ........................... yes
Native Spellchecker .................... no
WebRTC ................................. no
Use System Ninja ....................... no
Geolocation ............................ yes
WebChannel support ..................... yes
Use v8 snapshot ........................ yes
Kerberos Authentication ................ no
Building v8 snapshot supported ......... yes
Use ALSA ............................... no
Use PulseAudio ......................... no
Optional system libraries used:
re2 .................................. no
icu .................................. no
libwebp, libwebpmux and libwebpdemux . no
opus ................................. no
ffmpeg ............................... no
libvpx ............................... no
snappy ............................... no
glib ................................. no
zlib ................................. no
minizip .............................. no
libevent ............................. no
jsoncpp .............................. no
protobuf ............................. no
libxml2 and libxslt .................. no
lcms2 ................................ no
png .................................. no
JPEG ................................. no
harfbuzz ............................. no
freetype ............................. no
x11 .................................. no
Required system libraries:
fontconfig ........................... no
dbus ................................. no
nss .................................. no
khr .................................. no
glibc ................................ no
Required system libraries for qpa-xcb:
libdrm ............................... no
xcomposite ........................... no
xcursor .............................. no
xi ................................... no
xrandr ............................... no
xtst ................................. noNote: Also available for Linux: linux-clang linux-icc
Note: Using static linking will disable the use of dynamically
loaded plugins. Make sure to import all needed static plugins,
or compile needed modules into the library.Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.
WARNING: Cross compiling without sysroot. Disabling pkg-config
WARNING: gperf is required to build QtWebEngine.
Qt is now configured for building. Just run 'make'.
Once everything is built, Qt is installed.
You should NOT run 'make install'.
Note that this build cannot be deployed to other machines or devices.Prior to reconfiguration, make sure you remove any leftovers from
the previous build. -
So i managed to build it with the command:
make module-qtbase module-qtdeclarative
Now I need to figure out how build a test a project and add qt for webassembly as a kit to qt creator. Specifically, I'm not sure what the make path is referring too when I add a compiler.
-
In the preferences, go to Build And Run, then Qt Versions. Once you added your custom Qt, create a Kit for it and you are ready to go.