I built my opencv libraries for WebAssembly and have a simple program,My Program:
My CMakeLists.txt:
I am running
emmake cmake .and
makeI am getting an error:
clang-14: warning: argument unused during compilation: '-mmacosx-version-min=10.15' [-Wunused-command-line-argument]
In file included from /Users/arvindarya/Desktop/aspen/image.cpp:3:
In file included from /Users/arvindarya/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/iostream:37:
In file included from /Users/arvindarya/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/ios:215:
/Users/arvindarya/emsdk/upstream/emscripten/cache/sysroot/include/c++/v1/__locale:40:11: fatal error: 'xlocale.h' file not found
# include <xlocale.h>
^~~~~~~~~~~
1 error generated.
em++: error: '/Users/arvindarya/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -DEMSCRIPTEN -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=0 -D__EMSCRIPTEN_tiny__=0 -D_LIBCPP_ABI_VERSION=2 -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/Users/arvindarya/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -I/Users/arvindarya/Desktop/aspen/opencv/include -I/Users/arvindarya/Desktop/aspen/opencv/build_wasm -I/Users/arvindarya/Desktop/aspen/opencv/modules/calib3d/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/core/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/dnn/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/features2d/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/flann/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/gapi/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/highgui/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/imgcodecs/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/imgproc/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/ml/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/objdetect/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/photo/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/stitching/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/ts/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/video/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/videoio/include -I/Users/arvindarya/Desktop/aspen/opencv/modules/world/include -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.15 -std=gnu++11 -MD -MT CMakeFiles/hello.dir/image.cpp.o -MF CMakeFiles/hello.dir/image.cpp.o.d -c /Users/arvindarya/Desktop/aspen/image.cpp -o CMakeFiles/hello.dir/image.cpp.o' failed (returned 1)
make[2]: *** [CMakeFiles/hello.dir/image.cpp.o] Error 1
make[1]: *** [CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2
Can anyone help me with this.I want to run a WebAssembly with some opencv this is the most basic code. Is something wrong with my CMake. I cannot even get <iostream> work there is something seriously wrong. Please help me. I have tried emcc --clear-cache it does not work.