# Converting a cpp file with opencv modules to wasm

**URL:** <https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973>\
**Category:** C++\
**Tags:** emscripten\
**Created:** [April 25, 2021, 1:02pm UTC](https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973 "2021-04-25T13:02:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheSlyOne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/theslyone/32/958_2.png) [@TheSlyOne](https://forum.opencv.org/u/TheSlyOne)\
**Post date:** [April 25, 2021, 1:02pm UTC](https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973/1 "2021-04-25T13:02:48Z")

</div>

Could someone please help me with converting a cpp file that includes opencv modules to wasm? what are the steps I need to achieve the same? I tried the documentation [Building Projects — Emscripten 2.0.16 documentation](https://emscripten.org/docs/compiling/Building-Projects.html#using-libraries) . But I have encountered several errors when I ran the emcmake cmake command on the opencv source. Could someone point me in the right direction?  
please check this link for details regarding my issue here [https://groups.google.com/g/emscripten-discuss/c/Giy-5WOp9Fg/m/ma3aS1\_XAQAJ](https://groups.google.com/g/emscripten-discuss/c/Giy-5WOp9Fg/m/ma3aS1_XAQAJ)  
I’m actually not sure if these are even the right steps to take in order to compile my application to wasm.

Basically I want to run my simple cpp application that prints a matrix and uses opencv module in the browser using wasm through emscripten.

Please help.  
Thanks.

---

<div class="post-metadata">

**Author:** ![matti.vuori](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@matti.vuori](https://forum.opencv.org/u/matti.vuori)\
**Post date:** [April 25, 2021, 4:45pm UTC](https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973/2 "2021-04-25T16:45:37Z")

</div>

There seems to be a problem with ittnotify. It should be possible to leave it off an OpenCV build by turning Cmake flags BUILD\_ITT and WITH\_ITT off. If I understand right, it is optional and for just profiling purposes.

---

<div class="post-metadata">

**Author:** ![TheSlyOne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/theslyone/32/958_2.png) [@TheSlyOne](https://forum.opencv.org/u/TheSlyOne)\
**Post date:** [April 25, 2021, 8:15pm UTC](https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973/3 "2021-04-25T20:15:31Z")

</div>

yes! you are correct. Thank you.

---

<div class="post-metadata">

**Author:** ![TheSlyOne](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/theslyone/32/958_2.png) [@TheSlyOne](https://forum.opencv.org/u/TheSlyOne)\
**Post date:** [April 25, 2021, 8:42pm UTC](https://forum.opencv.org/t/converting-a-cpp-file-with-opencv-modules-to-wasm/2973/4 "2021-04-25T20:42:27Z")

</div>

now I get this error…

**Users/atul109/MyDocuments/work/new/emscripten\_playground/opencv-3.4.14/modules/core/include/opencv2/core/hal/intrin\_wasm.hpp:1566:1:**  **error:**  **always\_inline function ‘wasm\_v128\_load’ requires target feature ‘simd128’, but would be inlined into function ‘v\_load’ that is compiled without support for 'simd128’**

OPENCV\_HAL\_IMPL\_WASM\_LOADSTORE\_INT\_OP(v\_uint8x16, uchar)

Please help.
