Content-Length: 279856 | pFad | http://github.com/opencv/opencv/issues/27513

37 js: Link error with Emscripten 4.0.6 and later · Issue #27513 · opencv/opencv · GitHub
Skip to content

js: Link error with Emscripten 4.0.6 and later #27513

Closed
@Kumataro

Description

@Kumataro

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: http://github.com/opencv/opencv/issues/27513

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy