I have remove emsdk, then install and activate.
I have remove Python xx and install Python 3.9.
emcc error doesn’t not occur anymore but I get another error :
C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js>python build_js.py --opencv_dir C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources --emscripten_dir C:\emsdk\upstream\emscripten C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\buildCBA
Args: Namespace(build_dir=‘C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\buildCBA’, opencv_dir=‘C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources’, emscripten_dir=‘C:\emsdk\upstream\emscripten’, build_wasm=False, disable_wasm=False, threads=False, simd=False, build_test=False, build_perf=False, build_doc=False, clean_build_dir=False, skip_config=False, config_only=False, enable_exception=False, cmake_option=None, build_flags=None, build_wasm_intrin_test=False, config=‘C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js\opencv_js.config.py’)
Check dir C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\buildCBA (create: True, clean: False)
Check dir C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources (create: False, clean: False)
Check dir C:\emsdk\upstream\emscripten (create: False, clean: False)
===== Config OpenCV.js build for default target
Executing: [‘cmake’, ‘-DENABLE_PIC=FALSE’, ‘-DCMAKE_BUILD_TYPE=Release’, “-DCMAKE_TOOLCHAIN_FILE=‘C:\emsdk\upstream\emscripten\cmake\Modules\Platform\Emscripten.cmake’”, “-DCPU_BASELINE=’’”, “-DCPU_DISPATCH=’’”, ‘-DCV_TRACE=OFF’, ‘-DBUILD_SHARED_LIBS=OFF’, ‘-DWITH_1394=OFF’, ‘-DWITH_ADE=OFF’, ‘-DWITH_VTK=OFF’, ‘-DWITH_EIGEN=OFF’, ‘-DWITH_FFMPEG=OFF’, ‘-DWITH_GSTREAMER=OFF’, ‘-DWITH_GTK=OFF’, ‘-DWITH_GTK_2_X=OFF’, ‘-DWITH_IPP=OFF’, ‘-DWITH_JASPER=OFF’, ‘-DWITH_JPEG=OFF’, ‘-DWITH_WEBP=OFF’, ‘-DWITH_OPENEXR=OFF’, ‘-DWITH_OPENGL=OFF’, ‘-DWITH_OPENVX=OFF’, ‘-DWITH_OPENNI=OFF’, ‘-DWITH_OPENNI2=OFF’, ‘-DWITH_PNG=OFF’, ‘-DWITH_TBB=OFF’, ‘-DWITH_TIFF=OFF’, ‘-DWITH_V4L=OFF’, ‘-DWITH_OPENCL=OFF’, ‘-DWITH_OPENCL_SVM=OFF’, ‘-DWITH_OPENCLAMDFFT=OFF’, ‘-DWITH_OPENCLAMDBLAS=OFF’, ‘-DWITH_GPHOTO2=OFF’, ‘-DWITH_LAPACK=OFF’, ‘-DWITH_ITT=OFF’, ‘-DWITH_QUIRC=OFF’, ‘-DBUILD_ZLIB=ON’, ‘-DBUILD_opencv_apps=OFF’, ‘-DBUILD_opencv_calib3d=ON’, ‘-DBUILD_opencv_dnn=ON’, ‘-DBUILD_opencv_features2d=ON’, ‘-DBUILD_opencv_flann=ON’, ‘-DBUILD_opencv_gapi=OFF’, ‘-DBUILD_opencv_ml=OFF’, ‘-DBUILD_opencv_photo=ON’, ‘-DBUILD_opencv_imgcodecs=OFF’, ‘-DBUILD_opencv_shape=OFF’, ‘-DBUILD_opencv_videoio=OFF’, ‘-DBUILD_opencv_videostab=OFF’, ‘-DBUILD_opencv_highgui=OFF’, ‘-DBUILD_opencv_superres=OFF’, ‘-DBUILD_opencv_stitching=OFF’, ‘-DBUILD_opencv_java=OFF’, ‘-DBUILD_opencv_java_bindings_generator=OFF’, ‘-DBUILD_opencv_js=ON’, ‘-DBUILD_opencv_python2=OFF’, ‘-DBUILD_opencv_python3=OFF’, ‘-DBUILD_opencv_python_bindings_generator=OFF’, ‘-DBUILD_EXAMPLES=OFF’, ‘-DBUILD_PACKAGE=OFF’, ‘-DBUILD_TESTS=OFF’, ‘-DBUILD_PERF_TESTS=OFF’, ‘-DBUILD_DOCS=OFF’, ‘-DWITH_PTHREADS_PF=OFF’, ‘-DCV_ENABLE_INTRINSICS=OFF’, ‘-DBUILD_WASM_INTRIN_TESTS=OFF’, “-DCMAKE_C_FLAGS=’-s USE_PTHREADS=0 '”, “-DCMAKE_CXX_FLAGS=’-s USE_PTHREADS=0 '”, ‘C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources’]
Re-run cmake no build system arguments
– Building for: Visual Studio 16 2019
– OpenCV: system-specific configuration file is not found: ‘Emscripten’
– Detected processor: x86
– Found PythonInterp: C:/Users/Chris/AppData/Local/Programs/Python/Python39/python.exe (found suitable version “3.9”, minimum required is “2.7”)
CMake Warning at cmake/OpenCVDetectPython.cmake:81 (message):
CMake’s ‘find_host_package(PythonInterp 2.7)’ found wrong Python version:
PYTHON_EXECUTABLE=C:/Users/Chris/AppData/Local/Programs/Python/Python39/python.exe
PYTHON_VERSION_STRING=3.9
Consider providing the ‘PYTHON2_EXECUTABLE’ variable via CMake command line
or environment variables
Call Stack (most recent call first):
cmake/OpenCVDetectPython.cmake:271 (find_python)
CMakeLists.txt:607 (include)
– Could NOT find Python2 (missing: Python2_EXECUTABLE Interpreter)
Reason given by package:
Interpreter: Wrong major version for the interpreter “C:/Users/Chris/AppData/Local/Programs/Python/Python39/python.exe”
– Found PythonInterp: C:/Users/Chris/AppData/Local/Programs/Python/Python39/python.exe (found suitable version “3.9”, minimum required is “3.2”)
– Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) (Required is at least version “3.9”)
– Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)
– If you want to enable Python/Numpy support, set the following variables:
– PYTHON2_INCLUDE_PATH
– PYTHON2_LIBRARIES (optional on Unix-like systems)
– PYTHON2_NUMPY_INCLUDE_DIRS
– PYTHON3_INCLUDE_PATH
– PYTHON3_LIBRARIES (optional on Unix-like systems)
– PYTHON3_NUMPY_INCLUDE_DIRS
– Performing Test HAVE_CXX_FSIGNED_CHAR
– Performing Test HAVE_CXX_FSIGNED_CHAR - Failed
– Performing Test HAVE_C_FSIGNED_CHAR
– Performing Test HAVE_C_FSIGNED_CHAR - Failed
– Performing Test HAVE_CXX_W
– Performing Test HAVE_CXX_W - Failed
– Performing Test HAVE_C_W
Traceback (most recent call last):
File “C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js\build_js.py”, line 269, in
builder.config()
File “C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js\build_js.py”, line 192, in config
execute(cmd)
File “C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js\build_js.py”, line 19, in execute
retcode = subprocess.call(cmd, shell=shell, env=env)
File “C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\subprocess.py”, line 351, in call
return p.wait(timeout=timeout)
File “C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\subprocess.py”, line 1185, in wait
return self._wait(timeout=timeout)
File “C:\Users\Chris\AppData\Local\Programs\Python\Python39\lib\subprocess.py”, line 1466, in _wait
result = _winapi.WaitForSingleObject(self._handle,
KeyboardInterrupt
^C
C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js>