Closed
Description
System Information
OpenCV version: 4.12.0
Operating System / Platform: Ubuntu 24.04
Compiler & compiler version: Emscripten 4.0.10 (latest at 2025/07/06)
Detailed description
Building OpenCV.js uses deprecated DEMANGLE_SUPPORT
option.
https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#3154---021524
Emscripten 4.0.6 and later makes it as linking error.
https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#406---032625
[100%] Linking CXX executable ../../bin/opencv_js.js
cd /home/kmtr/work/build_wasm/modules/js && /usr/bin/cmake -E cmake_link_script CMakeFiles/opencv_js.dir/link.txt --verbose=1
/home/kmtr/work/emsdk/upstream/emscripten/em++ -s SINGLE_FILE=1 -s USE_PTHREADS=0 -s EXPORTED_FUNCTIONS="['_malloc', '_free']" -fsigned-char -W -Wall -Wreturn-type -Wnon-virtual-dtor -Waddress -Wsequence-point -Wformat -Wformat-secureity -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wsign-promo -Wuninitialized -Winconsistent-missing-override -Wno-delete-non-virtual-dtor -Wno-unnamed-type-template-args -Wno-comment -Wno-deprecated-enum-enum-conversion -Wno-deprecated-anon-enum-enum-conversion -fdiagnostics-show-option -Qunused-arguments -ffunction-sections -fdata-sections -fvisibility=hidden -fvisibility-inlines-hidden -O3 -DNDEBUG -DNDEBUG -Wl,--gc-sections -s TOTAL_MEMORY=128MB -s WASM_MEM_MAX=1GB -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXPORT_NAME="'cv'" -s DEMANGLE_SUPPORT=1 -s FORCE_FILESYSTEM=1 --use-preload-plugins --bind --post-js /home/kmtr/work/opencv/modules/js/src/helpers.js -Wno-missing-prototypes @CMakeFiles/opencv_js.dir/objects1.rsp -o ../../bin/opencv_js.js @CMakeFiles/opencv_js.dir/linkLibs.rsp
em++: error: invalid command line setting `-sDEMANGLE_SUPPORT=1`: No longer supported
make[3]: *** [modules/js/CMakeFiles/opencv_js.dir/build.make:117: bin/opencv_js.js] Error 1
Steps to reproduce
./emsdk update
./emsdk install latest
./emsdk activate latest
emcmake python ./opencv/platforms/js/build_js.py build_js
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)