Ubuntu compile Qt failed
-
@SGaist Hi,thanks for your reply. I am using emcc. And the information of emcc can be found below:
lixing@lixing-virtual-machine:~/project$ em++ -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 1.38.28
clang version 6.0.1 (https://github.com/emscripten-core/emscripten-fastcomp-clang 605a43bd86aa1f7571e169f606d2ea06cdd835a2) (https://github.com/emscripten-core/emscripten-fastcomp e7cdb2a092b096d7116c90a25b82456899dcdc4c) (emscripten 1.38.28 : 1.38.28)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/lixing/myfastcomp/emscripten-fastcomp/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64
shared:INFO: (Emscripten: Running sanity checks) -
Hi guys! I want to join you conversation because I have the same problem.
So I will start from the beginning.
I tried to compile just created(with help of Qt Creator) untouched GUI project. Icd
to project directory and run/path/to/qt/install/dir/5.13.0/wasm_32/bin/qmake qtwindow.pro
(emsdk was activated beforesource /path/to/emsdk/emsdk_env.sh
). Thenmake
and here I dot errors:error: undefined symbol: _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKcj error: undefined symbol: _Znaj error: undefined symbol: _Znwj error: undefined symbol: _ZnwjRKSt9nothrow_t
First I tried to solve them but without any luck. Digging in the internet make me think that "may be problem in QT, maybe it was compiled with most recent libs or something". So I decided to compile QT from source. I followed instructions in https://blog.qt.io/blog/2018/11/19/getting-started-qt-webassembly/ but stuck on step
make module-qtbase module-qtdeclarative
with next error:em++ -c -pipe -O3 -Oz -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -s ALLOW_MEMORY_GROWTH=1 -Wall -W -Wdate-time -Winconsistent-missing-override -DQT_NO_USING_NAMESPACE -DQT_NO_FOREACH -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DPCRE2_CODE_UNIT_WIDTH=16 -I. -I../3rdparty/zlib/src -Iglobal -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I../3rdparty -I../3rdparty/double-conversion/include -I../3rdparty/double-conversion/include/double-conversion -I../3rdparty/forkfd -I../3rdparty/tinycbor/src -I../../include -I../../include/QtCore -I../../include/QtCore/5.13.0 -I../../include/QtCore/5.13.0/QtCore -I.moc -I.tracegen -I../3rdparty/pcre2/src -I../../mkspecs/wasm-emscripten -o .obj/qendian.o global/qendian.cpp In file included from global/qendian.cpp:44: In file included from ../../include/QtCore/5.13.0/QtCore/private/qsimd_p.h:1: ../../include/QtCore/5.13.0/QtCore/private/../../../../../src/corelib/tools/qsimd_p.h:196:14: fatal error: 'x86intrin.h' file not found # include <x86intrin.h> ^~~~~~~~~~~~~ 1 error generated.
I tried to edit
qtbase/src/corelib/Makefile
and add next paths to em++(-I option)locate x86intrin.h /home/codepriest/Android/Sdk/build-tools/26.0.2/renderscript/clang-include/x86intrin.h /home/codepriest/Android/Sdk/build-tools/27.0.3/renderscript/clang-include/x86intrin.h /home/codepriest/Works/playground/emsdk/clang/fastcomp/build_incoming_64/lib/clang/6.0.1/include/x86intrin.h /home/codepriest/Works/playground/emsdk/clang/fastcomp/src/tools/clang/lib/Headers/x86intrin.h /srv/big-data/qt/Tools/QtCreator/libexec/qtcreator/clang/lib/clang/7.0.0/include/x86intrin.h /usr/lib64/clang/4.0.1/include/x86intrin.h /usr/lib64/gcc/x86_64-suse-linux/4.8/include/x86intrin.h /usr/lib64/gcc/x86_64-suse-linux/8/include/x86intrin.h
It solve problem with missing x86intrin.h(and other libs) but it start to complain on content of this headers, it look like it is not compatible with QT or emscripten or something like that(if it important I can reproduce this error).
Thanks in advance.
-
I suggest asking on interest Qt mailing list - the devs behind wasm hang out there, they might be able to help.
-
How we can ask them? Can you share email address or something?
-
-
@sierdzio said in Ubuntu compile Qt failed:
I suggest asking on interest Qt mailing list - the devs behind wasm hang out there, they might be able to help.
Sorry, I didn't realize there were people actually using it and posting issues here. :)
-
I use Fedora 29 kernel 5 for the OS, Qt 5.12.3 from source and Ryzen for processor. Just remove or comment some line of codes from the file
~/[QT Source Directory]/qtbase/src/corelib/tools/qsimd_p.hfind " include <x86intrin.h>"
this from my file:# if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) // GCC 4.4 and Clang 2.8 added a few more intrinsics there # include <x86intrin.h> # endif
after change:
/* # if defined(Q_CC_GNU) && !defined(Q_CC_INTEL) // GCC 4.4 and Clang 2.8 added a few more intrinsics there # include <x86intrin.h> # endif */
and everything work fine now.
Sorry for my language :)