emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.8k stars 3.31k forks source link

opencv_js: Including <emscripten/bind.h> requires building with -std=c++11 or newer! #20001

Open meakcey opened 1 year ago

meakcey commented 1 year ago

System Information CMake = 3.26.4 OpenCV = 4.8 Operating System / Platform = Windows 64 Bit Compiler = Visual Studio 2019

I am trying to compile OpenCV 4.8 from source including opencv_js I have setup the emscripten and defined the paths.

I am getting error on building opencv_js as Including <emscripten/bind.h> requires building with -std=c++11 or newer!

Could not find any solution.

brendandahl commented 1 year ago

The error has what you need, build with -std=c++11 or newer. Cmake has instructions on how to do this too.

meakcey commented 1 year ago

I have already to tried to add entry as CMAKE_CXX_STANDARD 11 and 14 but did not work. I have also checked project properties on VS, that is set as 14 but somehow it could not pass that error pragma.

sbc100 commented 1 year ago

Can you show the full set of commands you used to configure and build the project, along with the full failing command line.

I'm somewhat concerned by your mention of Visual Studio since emscripten doesn't support building in visual studio. Did you use emcmake when running cmake?