Can somebody help me with emcmake error finding FindQt5.cmake
-
I am trying to build project on Ubuntu with this command:
emcmake cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/Qt/5.15.2/wasm_32/
and get this error
CMake Error at CMakeLists.txt:16 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
i checked in Qt5 folder for Qt5Config.cmake file - it's exist :/
Now i don't know what to do.Changed -DCMAKE_PREFIX_PATH few times, checked using chatGTP version of Qt, Cmake and Emscripten for comparability, reinstalled Emscripten, added this to cmake file:
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/home/oleksiy/Qt/5.15.2/wasm_32/lib/cmake/Qt5/")
That's the output when i've enabled verbose
/home/oleksiy/TestWebAssembly/CMakeLists.txt(10): set(CMAKE_AUTORCC ON ) /home/oleksiy/TestWebAssembly/CMakeLists.txt(12): set(CMAKE_CXX_STANDARD 11 ) /home/oleksiy/TestWebAssembly/CMakeLists.txt(13): set(CMAKE_CXX_STANDARD_REQUIRED ON ) /home/oleksiy/TestWebAssembly/CMakeLists.txt(20): set(CMAKE_PREFIX_PATH /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/ ) /home/oleksiy/TestWebAssembly/CMakeLists.txt(22): find_package(Qt5 COMPONENTS Widgets Core Gui Quick REQUIRED ) CMake Error at CMakeLists.txt:22 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed.
I even build qt from source.
i've added --debug-find flag to cmake comand, the output:configure: cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug/ --debug-find -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads Running with debug output on for the `find` commands. CMake Debug Log at CMakeLists.txt:22 (find_package): find_package considered the following paths for Qt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/emscripten/cmake/Modules/FindQt5.cmake /usr/share/cmake-3.22/Modules/FindQt5.cmake The file was not found. <PackageName>_ROOT CMake variable [CMAKE_FIND_USE_PACKAGE_ROOT_PATH]. none CMAKE_PREFIX_PATH variable [CMAKE_FIND_USE_CMAKE_PATH]. /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten-debug CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH variables [CMAKE_FIND_USE_CMAKE_PATH]. Env variable Qt5_DIR [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none CMAKE_PREFIX_PATH env variable [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH env variables [CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH]. none Paths specified by the find_package HINTS option. none Standard system environment variables [CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH]. /usr/local /usr / /usr/games /usr/local/games /snap CMake User Package Registry [CMAKE_FIND_USE_PACKAGE_REGISTRY]. none CMake variables defined in the Platform file [CMAKE_FIND_USE_CMAKE_SYSTEM_PATH]. none CMake System Package Registry [CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY]. none Paths specified by the find_package PATHS option. none find_package considered the following locations for the Config module: /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake /usr/share/emscripten/cache/sysroot/Qt5Config.cmake /usr/share/emscripten/cache/sysroot/qt5-config.cmake The file was not found. CMake Error at CMakeLists.txt:22 (find_package): By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files. If "Qt5" provides a separate development package or SDK, be sure it has been installed. CMake Debug Log at CMakeLists.txt:22 (find_package): -- Configuring incomplete, errors occurred! See also "/home/oleksiy/TestWebAssembly/build-debug/CMakeFiles/CMakeOutput.log". emcmake: error: 'cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug/ --debug-find -DCMAKE_TOOLCHAIN_FILE=/usr/share/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/usr/bin/node;--experimental-wasm-threads' failed (returned 1)
I can't figure out why cmake search can't follow CMAKE_PREFIX_PATH.
CMakeLists.txt
cmake_minimum_required(VERSION 3.5) project(TestWebAssembly VERSION 0.1 LANGUAGES CXX) set(CMAKE_C_COMPILER "emcc") set(CMAKE_CXX_COMPILER "em++") set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) #set(CMAKE_SYSTEM_NAME Emscripten) #set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/bin/qmake") #set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/") #set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/home/oleksiy/Qt/5.15.2/wasm_32/lib/cmake/Qt5/") #set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_PREFIX_PATH "/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug") find_package(Qt5 COMPONENTS Widgets Core Gui Quick REQUIRED) set(PROJECT_SOURCES main.cpp mainwindow.cpp mainwindow.h Main.qml ) add_executable(TestWebAssembly ${PROJECT_SOURCES} ) qt5_add_resources(QT_RESOURCES qml.qrc) target_link_libraries(TestWebAssembly PRIVATE Qt5::Widgets Qt5::Core Qt5::Quick)
-
well now added full path all needed modules in cmake command:
emcmake cmake .. -DCMAKE_PREFIX_PATH=/home/oleksiy/Qt/5.15.2/wasm_32/ --debug-find -DQt5_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5 -DQt5Widgets_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets -DQt5Gui_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui -DQt5Core_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Core -DQt5Svg_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Svg -DQt5Zlib_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Zlib -DQt5Network_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Network -DQt5EventDispatcherSupport_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5EventDispatcherSupport -DQt5FontDatabaseSupport_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5FontDatabaseSupport -DQt5EglSupport_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5EglSupport -DQt5Quick_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Quick -DQt5QmlModels_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5QmlModels -DQt5Qml_DIR=/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Qml
if know way to automate it, let me know pls
also i've changed CMakeLists.txt like this:cmake_minimum_required(VERSION 3.5) project(TestWebAssembly VERSION 0.1 LANGUAGES CXX) set(CMAKE_C_COMPILER "emcc") set(CMAKE_CXX_COMPILER "em++") set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) #set(CMAKE_SYSTEM_NAME Emscripten) #set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/bin/qmake") #set(QT_QMAKE_EXECUTABLE "/home/oleksiy/Qt/5.15.2/wasm_32/") #set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/home/oleksiy/Qt/5.15.2/wasm_32/lib/cmake/Qt5/") #set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_PREFIX_PATH "/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s FETCH") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s MODULARIZE=1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS=\"['_main', '_embind_register_function', '_emval_as', '_emval_call', '_emval_call_method', '_emval_call_void_method', '_emval_decref', '_emval_equals', '_emval_get_global', '_emval_get_method_caller', '_emval_get_module_property', '_emval_get_property', '_emval_incref', '_emval_is_string', '_emval_new', '_emval_new_cstring', '_emval_new_object', '_emval_run_destructors', '_emval_set_property', '_emval_take_value', '_getentropy']\"") find_package(Qt5 5.15 REQUIRED COMPONENTS Widgets Core Gui Quick) set(PROJECT_SOURCES main.cpp mainwindow.cpp mainwindow.h Main.qml ) add_executable(TestWebAssembly ${PROJECT_SOURCES} ) #qt5_add_resources(QT_RESOURCES qml.qrc) target_link_libraries(TestWebAssembly PRIVATE Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Quick)
but now got this error
emmake make make: make CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QGifPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QICNSPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QICOPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QJpegPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QSvgIconPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QSvgPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QTgaPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QTiffPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QTuioTouchPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWasmIntegrationPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWbmpPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) at /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWebpPlugin.cmake:2 (add_library): ADD_LIBRARY called with MODULE option but the target platform does not support dynamic linking. Building a STATIC library instead. This may lead to problems. Call Stack (most recent call first): /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:393 (include) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:218 (find_package) /home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package) CMakeLists.txt:27 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Configuring done -- Generating done -- Build files have been written to: /home/oleksiy/TestWebAssembly/build-debug [ 7%] Automatic MOC and UIC for target TestWebAssembly [ 7%] Built target TestWebAssembly_autogen [ 14%] Building CXX object CMakeFiles/TestWebAssembly.dir/TestWebAssembly_autogen/mocs_compilation.cpp.o [ 21%] Building CXX object CMakeFiles/TestWebAssembly.dir/main.cpp.o [ 28%] Building CXX object CMakeFiles/TestWebAssembly.dir/mainwindow.cpp.o [ 35%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QGifPlugin_Import.cpp.o [ 42%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QICNSPlugin_Import.cpp.o [ 50%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QICOPlugin_Import.cpp.o [ 57%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QJpegPlugin_Import.cpp.o [ 64%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QTgaPlugin_Import.cpp.o [ 71%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QTiffPlugin_Import.cpp.o [ 78%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWasmIntegrationPlugin_Import.cpp.o [ 85%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWbmpPlugin_Import.cpp.o [ 92%] Building CXX object CMakeFiles/TestWebAssembly.dir/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten/lib/cmake/Qt5Gui/Qt5Gui_QWebpPlugin_Import.cpp.o [100%] Linking CXX executable TestWebAssembly.js error: undefined symbol: _embind_register_function (referenced by top-level compiled C/C++ code) warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on undefined symbols warning: To disable errors for undefined symbols use `-s ERROR_ON_UNDEFINED_SYMBOLS=0` warning: __embind_register_function may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_as (referenced by top-level compiled C/C++ code) warning: __emval_as may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_call (referenced by top-level compiled C/C++ code) warning: __emval_call may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_call_method (referenced by top-level compiled C/C++ code) warning: __emval_call_method may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_call_void_method (referenced by top-level compiled C/C++ code) warning: __emval_call_void_method may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_decref (referenced by top-level compiled C/C++ code) warning: __emval_decref may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_equals (referenced by top-level compiled C/C++ code) warning: __emval_equals may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_get_global (referenced by top-level compiled C/C++ code) warning: __emval_get_global may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_get_method_caller (referenced by top-level compiled C/C++ code) warning: __emval_get_method_caller may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_get_module_property (referenced by top-level compiled C/C++ code) warning: __emval_get_module_property may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_get_property (referenced by top-level compiled C/C++ code) warning: __emval_get_property may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_incref (referenced by top-level compiled C/C++ code) warning: __emval_incref may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_is_string (referenced by top-level compiled C/C++ code) warning: __emval_is_string may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_new (referenced by top-level compiled C/C++ code) warning: __emval_new may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_new_cstring (referenced by top-level compiled C/C++ code) warning: __emval_new_cstring may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_new_object (referenced by top-level compiled C/C++ code) warning: __emval_new_object may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_run_destructors (referenced by top-level compiled C/C++ code) warning: __emval_run_destructors may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_set_property (referenced by top-level compiled C/C++ code) warning: __emval_set_property may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: _emval_take_value (referenced by top-level compiled C/C++ code) warning: __emval_take_value may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library error: undefined symbol: getentropy (referenced by top-level compiled C/C++ code) warning: _getentropy may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library Error: Aborting compilation due to previous errors em++: error: '/home/oleksiy/Libraries/emsdk/node/18.20.3_64bit/bin/node /home/oleksiy/Libraries/emsdk/upstream/emscripten/src/compiler.js /tmp/tmp4qyhggid.txt' failed (1) make[2]: *** [CMakeFiles/TestWebAssembly.dir/build.make:333: TestWebAssembly.js] Error 1 make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/TestWebAssembly.dir/all] Error 2 make: *** [Makefile:91: all] Error 2
-
all you have to do is call qtpaths (found in
wasm_32/bin/qtpaths
) BEFORE you callemcmake
P.S.
This is TERRIBLE practice! let CMake set those variables, don't override themset(CMAKE_C_COMPILER "emcc") set(CMAKE_CXX_COMPILER "em++") set(CMAKE_PREFIX_PATH "/home/oleksiy/InstalledLibraries/Qt_5.15.2_wasm-emscripten_debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s FETCH") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s MODULARIZE=1") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS=\"['_main', '_embind_register_function', '_emval_as', '_emval_call', '_emval_call_method', '_emval_call_void_method', '_emval_decref', '_emval_equals', '_emval_get_global', '_emval_get_method_caller', '_emval_get_module_property', '_emval_get_property', '_emval_incref', '_emval_is_string', '_emval_new', '_emval_new_cstring', '_emval_new_object', '_emval_run_destructors', '_emval_set_property', '_emval_take_value', '_getentropy']\"")
-
@VRonin what if got only qtpaths.js?
If you mean run /home/oleksiy/Qt/5.15.2/wasm_32/bin/qtpaths.js i've got this errorRuntimeError: abort(RuntimeError: abort(RuntimeError: abort(Error: ENOENT: no such file or directory, open '/home/oleksiy/Qt/5.15.2/wasm_32/bin/qtpaths.wasm'). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info.). Build with -s ASSERTIONS=1 for more info. at process.abort (/home/oleksiy/Qt/5.15.2/wasm_32/bin/qtpaths.js:1:17201) at process.emit (events.js:314:20) at processPromiseRejections (internal/process/promises.js:209:33) at processTicksAndRejections (internal/process/task_queues.js:98:32)
P.s. i tried to fix build using chatgtpt and he give me this recommendations?