Opencv building from source : emcc error code 1 (Emscripten.cmake)

System information (version)
  • OpenCV => 4.5.0
  • Operating System / Platform => Windows 10 / 64 Bit
  • Compiler => Visual Studio 2021 1.54
  • Cmake 3.20.0-rc2
  • Emscripten 1.38.31
Detailed description

In a Windows CMD terminal, when I type the command :
build_js.py --opencv_dir C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources --emscripten_dir C:\Users\Chris\Desktop\Webdev\emsdk\emsdk-master\emscripten\1.38.31 C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\build

the following error occurs :
CMake Error at C:/Users/Chris/Desktop/Webdev/emsdk/emsdk-master/emscripten/1.38.31/cmake/Modules/Platform/Emscripten.cmake:113 (message):
Failed to fetch compiler version information with command
“‘C:/Users/Chris/Desktop/Webdev/emsdk/emsdk-master/emscripten/1.38.31/emcc.bat’
-v”! Process returned with error code 1.

run that. what does it say?

C:\WINDOWS\system32>C:/Users/Chris/Desktop/Webdev/emsdk/emsdk-master/emscripten/1.38.31/emcc.bat -v
Traceback (most recent call last):
  File "C:\Users\Chris\Desktop\Webdev\emsdk\emsdk-master\emscripten\1.38.31\\emcc.py", line 41, in <module>
    from tools import shared, system_libs, client_mods, js_optimizer, jsrun
  File "C:\Users\Chris\Desktop\Webdev\emsdk\emsdk-master\emscripten\1.38.31\tools\shared.py", line 782, in <module>
    CLANG_CC = os.path.expanduser(build_clang_tool_path(exe_suffix('clang')))
  File "C:\Users\Chris\Desktop\Webdev\emsdk\emsdk-master\emscripten\1.38.31\tools\shared.py", line 647, in build_clang_tool_path
    return os.path.join(LLVM_ROOT, tool)
  File "C:\Users\Chris\.windows-build-tools\python27\lib\ntpath.py", line 65, in join
    result_drive, result_path = splitdrive(path)
  File "C:\Users\Chris\.windows-build-tools\python27\lib\ntpath.py", line 115, in splitdrive
    if len(p) > 1:
TypeError: object of type 'NoneType' has no len()

LLVM_ROOT is None.

your toolchain is broken or improperly set up.

1 Like

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>

please give use this button to format your snippet of log:

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 <module>
    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>

that’s because you canceled the build process with Ctrl+C.

why did you want to abort it?

Because of all tests which seem to be failed:

-- 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

ignore that. those determine the capabilities of the compiler. some of those are even supposed to fail.

All the tests are failed, and at the end, the following error occurs :
 -- Configuring incomplete, errors occurred! 
  
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
    -- 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
    -- Performing Test HAVE_C_W - Failed
    -- Performing Test HAVE_CXX_WALL
    -- Performing Test HAVE_CXX_WALL - Failed
    -- Performing Test HAVE_C_WALL
    -- Performing Test HAVE_C_WALL - Failed
    -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE
    -- Performing Test HAVE_CXX_WERROR_RETURN_TYPE - Failed
    -- Performing Test HAVE_C_WERROR_RETURN_TYPE
    -- Performing Test HAVE_C_WERROR_RETURN_TYPE - Failed
    -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_CXX_WERROR_NON_VIRTUAL_DTOR - Failed
    -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_C_WERROR_NON_VIRTUAL_DTOR - Failed
    -- Performing Test HAVE_CXX_WERROR_ADDRESS
    -- Performing Test HAVE_CXX_WERROR_ADDRESS - Failed
    -- Performing Test HAVE_C_WERROR_ADDRESS
    -- Performing Test HAVE_C_WERROR_ADDRESS - Failed
    -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT
    -- Performing Test HAVE_CXX_WERROR_SEQUENCE_POINT - Failed
    -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT
    -- Performing Test HAVE_C_WERROR_SEQUENCE_POINT - Failed
    -- Performing Test HAVE_CXX_WFORMAT
    -- Performing Test HAVE_CXX_WFORMAT - Failed
    -- Performing Test HAVE_C_WFORMAT
    -- Performing Test HAVE_C_WFORMAT - Failed
    -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY
    -- Performing Test HAVE_CXX_WERROR_FORMAT_SECURITY - Failed
    -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY
    -- Performing Test HAVE_C_WERROR_FORMAT_SECURITY - Failed
    -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS
    -- Performing Test HAVE_CXX_WMISSING_DECLARATIONS - Failed
    -- Performing Test HAVE_C_WMISSING_DECLARATIONS
    -- Performing Test HAVE_C_WMISSING_DECLARATIONS - Failed
    -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES
    -- Performing Test HAVE_CXX_WMISSING_PROTOTYPES - Failed
    -- Performing Test HAVE_C_WMISSING_PROTOTYPES
    -- Performing Test HAVE_C_WMISSING_PROTOTYPES - Failed
    -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES
    -- Performing Test HAVE_CXX_WSTRICT_PROTOTYPES - Failed
    -- Performing Test HAVE_C_WSTRICT_PROTOTYPES
    -- Performing Test HAVE_C_WSTRICT_PROTOTYPES - Failed
    -- Performing Test HAVE_CXX_WUNDEF
    -- Performing Test HAVE_CXX_WUNDEF - Failed
    -- Performing Test HAVE_C_WUNDEF
    -- Performing Test HAVE_C_WUNDEF - Failed
    -- Performing Test HAVE_CXX_WINIT_SELF
    -- Performing Test HAVE_CXX_WINIT_SELF - Failed
    -- Performing Test HAVE_C_WINIT_SELF
    -- Performing Test HAVE_C_WINIT_SELF - Failed
    -- Performing Test HAVE_CXX_WPOINTER_ARITH
    -- Performing Test HAVE_CXX_WPOINTER_ARITH - Failed
    -- Performing Test HAVE_C_WPOINTER_ARITH
    -- Performing Test HAVE_C_WPOINTER_ARITH - Failed
    -- Performing Test HAVE_CXX_WSHADOW
    -- Performing Test HAVE_CXX_WSHADOW - Failed
    -- Performing Test HAVE_C_WSHADOW
    -- Performing Test HAVE_C_WSHADOW - Failed
    -- Performing Test HAVE_CXX_WSIGN_PROMO
    -- Performing Test HAVE_CXX_WSIGN_PROMO - Failed
    -- Performing Test HAVE_C_WSIGN_PROMO
    -- Performing Test HAVE_C_WSIGN_PROMO - Failed
    -- Performing Test HAVE_CXX_WUNINITIALIZED
    -- Performing Test HAVE_CXX_WUNINITIALIZED - Failed
    -- Performing Test HAVE_C_WUNINITIALIZED
    -- Performing Test HAVE_C_WUNINITIALIZED - Failed
    -- Performing Test HAVE_CXX_WINCONSISTENT_MISSING_OVERRIDE
    -- Performing Test HAVE_CXX_WINCONSISTENT_MISSING_OVERRIDE - Failed
    -- Performing Test HAVE_C_WINCONSISTENT_MISSING_OVERRIDE
    -- Performing Test HAVE_C_WINCONSISTENT_MISSING_OVERRIDE - Failed
    -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_CXX_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
    -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR
    -- Performing Test HAVE_C_WNO_DELETE_NON_VIRTUAL_DTOR - Failed
    -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
    -- Performing Test HAVE_CXX_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
    -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS
    -- Performing Test HAVE_C_WNO_UNNAMED_TYPE_TEMPLATE_ARGS - Failed
    -- Performing Test HAVE_CXX_WNO_COMMENT
    -- Performing Test HAVE_CXX_WNO_COMMENT - Failed
    -- Performing Test HAVE_C_WNO_COMMENT
    -- Performing Test HAVE_C_WNO_COMMENT - Failed
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_ENUM_ENUM_CONVERSION
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_ENUM_ENUM_CONVERSION - Failed
    -- Performing Test HAVE_C_WNO_DEPRECATED_ENUM_ENUM_CONVERSION
    -- Performing Test HAVE_C_WNO_DEPRECATED_ENUM_ENUM_CONVERSION - Failed
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_ANON_ENUM_ENUM_CONVERSION
    -- Performing Test HAVE_CXX_WNO_DEPRECATED_ANON_ENUM_ENUM_CONVERSION - Failed
    -- Performing Test HAVE_C_WNO_DEPRECATED_ANON_ENUM_ENUM_CONVERSION
    -- Performing Test HAVE_C_WNO_DEPRECATED_ANON_ENUM_ENUM_CONVERSION - Failed
    -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION
    -- Performing Test HAVE_CXX_FDIAGNOSTICS_SHOW_OPTION - Failed
    -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION
    -- Performing Test HAVE_C_FDIAGNOSTICS_SHOW_OPTION - Failed
    -- Performing Test HAVE_CXX_PTHREAD
    -- Performing Test HAVE_CXX_PTHREAD - Failed
    -- Performing Test HAVE_C_PTHREAD
    -- Performing Test HAVE_C_PTHREAD - Failed
    -- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS
    -- Performing Test HAVE_CXX_QUNUSED_ARGUMENTS - Failed
    -- Performing Test HAVE_C_QUNUSED_ARGUMENTS
    -- Performing Test HAVE_C_QUNUSED_ARGUMENTS - Failed
    -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS
    -- Performing Test HAVE_CXX_FFUNCTION_SECTIONS - Failed
    -- Performing Test HAVE_C_FFUNCTION_SECTIONS
    -- Performing Test HAVE_C_FFUNCTION_SECTIONS - Failed
    -- Performing Test HAVE_CXX_FDATA_SECTIONS
    -- Performing Test HAVE_CXX_FDATA_SECTIONS - Failed
    -- Performing Test HAVE_C_FDATA_SECTIONS
    -- Performing Test HAVE_C_FDATA_SECTIONS - Failed
    -- Performing Test HAVE_CPU_BASELINE_FLAGS
    -- Performing Test HAVE_CPU_BASELINE_FLAGS - Failed
    CMake Error at cmake/OpenCVCompilerOptimizations.cmake:593 (message):
      Compiler doesn't support baseline optimization flags:
    Call Stack (most recent call first):
      cmake/OpenCVCompilerOptions.cmake:296 (ocv_compiler_optimization_options)
      CMakeLists.txt:610 (include)


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/Chris/Desktop/Webdev/opencv_4.5.0_w/buildCBA/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/Chris/Desktop/Webdev/opencv_4.5.0_w/buildCBA/CMakeFiles/CMakeError.log".
    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 <module>
        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 23, in execute
        raise Fail("Child returned: %s" % retcode)
    __main__.Fail: Child returned: 1

    C:\Users\Chris\Desktop\Webdev\opencv_4.5.0_w\opencv\sources\platforms\js>

okay… ALL of them failing is good information.

what compilers do you have installed?

I have the following compiler on ma computer :
Microsoft Visual C++ 2015-2019  Redistributable (x64) 14.28.29910

that is just the runtime. you need an actual compiler

your options:

  • visual studio, VS community, or some way of getting MS C++ compiler/toolchain on its own. then you can use the prebuilt opencv package from opencv.org
  • MinGW standalone or as part of msys2, but then you need to build opencv yourself
  • WSL, which is equivalent to a full blown linux
I have the following  on my computer for Visual Studio (2.00 Go):
Windows Software Development Kit  - Windows 10.0.19041.685

And what about this error in the log :

– 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

is it compliant to have in the log at the begining :
– OpenCV: system-specific configuration file is not found: ‘Emscripten’

I have installed WSL.
I got the emcc error (see attached file).![build_error|690x387](upload://xx4D7381FtJ7lB7UmPs8M3CaPvZ.jpeg) 
The result of emcc command is attached in the second file.![emcc_error|690x387](upload://kKfDL9eUSgCX3VP4Tn0BKLuZpCt.jpeg)

I have move to my second PC (Lubuntu 20.04) and it is ok, I get an opencv_js.js file.

Thanks.

This topic can be closed or suppressed.