Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with installing OpenCV JS on Windows 10 #13842

Open
jonathan-noble opened this issue Feb 15, 2019 · 7 comments
Open

Issues with installing OpenCV JS on Windows 10 #13842

jonathan-noble opened this issue Feb 15, 2019 · 7 comments

Comments

@jonathan-noble
Copy link

  • OpenCV => 4.0.1 and previous versions
  • Operating System / Platform => Windows 10 64 Bit
  • Compiler => Visual Studio 2017

I am on the process of installing OpenCV JS and I've encountered simple errors here and there that can be found by searching via Google.
However, I'm currently on an error that is irresolvable at the moment and is something out of my limit. I'm about to build opencv.js with this:
python build_js.py build_js --emscripten_dir=C:\Users\schma\Documents\DulChunCinn\opencv-js\emsdk

And this is the error I get:

CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:186 (message):
  OpenCV 4.x requires C++11
Call Stack (most recent call first):
  CMakeLists.txt:156 (include)


-- Configuring incomplete, errors occurred!
See also "C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/platforms/js/build_js/CMakeFiles/CMakeOutput.log".
See also "C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/platforms/js/build_js/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
  File "build_js.py", line 227, in <module>
    builder.config()
  File "build_js.py", line 167, in config
    execute(cmd)
  File "build_js.py", line 23, in execute
    raise Fail("Child returned: %s" % retcode)
__main__.Fail: Child returned: 1

I tried running with the latest versions of OpenCV (i.e. 4.0.1), of Emscripten SDK and also of CMake. Moreover, I tried it with their previous versions as well.

Any kind of help would be highly appreciated. Thanks in advance.

P.S. For all it's worth, here's the CMakeError.log:

Compilation failed:
    source file: 'C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/cmake/checks/cxx11.cpp'
    check option: ''
===== BUILD LOG =====
Change Dir: C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/platforms/js/build_js/CMakeFiles/CMakeTmp

Run Build Command:"C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/MSBuild/15.0/Bin/MSBuild.exe" "cmTC_36d58.vcxproj" "/p:Configuration=Debug" "/p:Platform=Win32" "/p:VisualStudioVersion=15.0"
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework

Copyright (C) Microsoft Corporation. All rights reserved.



Build started 15-Feb-19 7:16:47 PM.

Project "C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj" on node 1 (default targets).

PrepareForBuild:

  Creating directory "cmTC_36d58.dir\Debug\".

  Creating directory "C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\Debug\".

  Creating directory "cmTC_36d58.dir\Debug\cmTC_36d58.tlog\".

InitializeBuildStatus:

  Creating "cmTC_36d58.dir\Debug\cmTC_36d58.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.

ClCompile:

  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\CL.exe /c /W1 /WX- /diagnostics:classic /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_36d58.dir\Debug\\" /Fd"cmTC_36d58.dir\Debug\vc141.pdb" /Gd /TP /analyze- /errorReport:queue  -g "C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\cmake\checks\cxx11.cpp"

  Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86

  Copyright (C) Microsoft Corporation.  All rights reserved.

  

  cxx11.cpp

  cl /c /W1 /WX- /diagnostics:classic /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_36d58.dir\Debug\\" /Fd"cmTC_36d58.dir\Debug\vc141.pdb" /Gd /TP /analyze- /errorReport:queue  -g "C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\cmake\checks\cxx11.cpp"

  

cl : Command line warning D9002: ignoring unknown option '-g' [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]

Link:

  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe /ERRORREPORT:QUEUE /OUT:"C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\Debug\cmTC_36d58.js" /INCREMENTAL /NOLOGO /MANIFEST:NO /PDB:"C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/platforms/js/build_js/CMakeFiles/CMakeTmp/Debug/cmTC_36d58.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/Users/schma/Documents/DulChunCinn/opencv-js/opencv/platforms/js/build_js/CMakeFiles/CMakeTmp/Debug/" /MACHINE:X86 /SAFESEH  --default-obj-ext .obj cmTC_36d58.dir\Debug\cxx11.obj

LINK : warning LNK4044: unrecognized option '/-default-obj-ext'; ignored [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]

LINK : fatal error LNK1104: cannot open file '.obj' [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]

Done Building Project "C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj" (default targets) -- FAILED.



Build FAILED.



"C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj" (default target) (1) ->

(ClCompile target) -> 

  cl : Command line warning D9002: ignoring unknown option '-g' [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]





"C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj" (default target) (1) ->

(Link target) -> 

  LINK : warning LNK4044: unrecognized option '/-default-obj-ext'; ignored [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]





"C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj" (default target) (1) ->

(Link target) -> 

  LINK : fatal error LNK1104: cannot open file '.obj' [C:\Users\schma\Documents\DulChunCinn\opencv-js\opencv\platforms\js\build_js\CMakeFiles\CMakeTmp\cmTC_36d58.vcxproj]



    2 Warning(s)

    1 Error(s)



Time Elapsed 00:00:01.24


===== END =====


@littleylv
Copy link

You see that? CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:186 (message): OpenCV 4.x requires C++11

@alalek
Copy link
Member

alalek commented Jun 17, 2019

It is because all compiler checks are failed (it tries to compile via MSVC - this is definitely wrong for JavaScript).
JavaScript build on Windows is not supported for now.


OpenCV.js build scripts works on Linux (if you have proper version of emscripten).
Build logs for JavaScripts builds are available on OpenCV CI.

@kavikode
Copy link

I am having trouble building
OpenCV.js on Windowa 10 64 bit. Will you please help me?

For installing Emscripten SDK, I used emsdk-1.35.0-full-64bit.exe,
link: https://emscripten.org/docs/getting_started/downloads.html

I have the following configuration:
Python 2.7.14
gcc (MinGW.org GCC-8.2.0-3) 8.2.0
Node 8.10.0
g++ (MinGW.org GCC-8.2.0-3) 8.2.0
git 2.18.0.windows.1
java 1.7.0_45
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
cmake 3.15.0

After I type "python ./platforms/js/build_js.py build_js
--emscripten_dir=/emsdk/" I get the following error message;
Args: Namespace(build_dir='build_js', build_doc=False,
build_test=False, build_wasm=False, clean_build_dir=False,
config_only=False, disable_wasm=False, emscripten_dir='
/emsdk/',
enable_exception=False, opencv_dir='C:\Users\Kavita\opencv',
skip_config=False)
Check dir C:\Users\Kavita\opencv\build_js (create: True, clean: False)
Check dir C:\Users\Kavita\opencv (create: False, clean: False)
Check dir C:\Users\Kavita\opencv~\emsdk (create: False, clean: False)

===== Config OpenCV.js build for default target

Executing: ['cmake', '-DCMAKE_BUILD_TYPE=Release',
"-DCMAKE_TOOLCHAIN_FILE='C:\Users\Kavita\opencv\~\emsdk\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_PTHREADS_PF=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',
'C:\Users\Kavita\opencv']
Re-run cmake no build system arguments
CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:75
(message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:98
(CMAKE_FORCE_C_COMPILER)
build_js/CMakeFiles/3.15.0/CMakeSystem.cmake:6 (include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:89
(message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:99
(CMAKE_FORCE_CXX_COMPILER)
build_js/CMakeFiles/3.15.0/CMakeSystem.cmake:6 (include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:75
(message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:98
(CMAKE_FORCE_C_COMPILER)
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/CMakeSystemSpecificInformation.cmake:90
(include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:89
(message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:99
(CMAKE_FORCE_CXX_COMPILER)
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/CMakeSystemSpecificInformation.cmake:90
(include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:75
(message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:98
(CMAKE_FORCE_C_COMPILER)
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeCXXInformation.cmake:65
(include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:89
(message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:99
(CMAKE_FORCE_CXX_COMPILER)
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeCXXInformation.cmake:65
(include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:75
(message):
The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set
CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:98
(CMAKE_FORCE_C_COMPILER)
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeCInformation.cmake:66
(include)
CMakeLists.txt:137 (project)

CMake Deprecation Warning at C:/Program
Files/CMake/share/cmake-3.15/Modules/CMakeForceCompiler.cmake:89
(message):
The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set
CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
C:/Program Files/Emscripten/emscripten/1.35.0/cmake/Modules/Platform/Emscripten.cmake:99
(CMAKE_FORCE_CXX_COMPILER)
C:/Program Files/CMake/share/cmake-3.15/Modules/CMakeCInformation.cmake:66
(include)
CMakeLists.txt:137 (project)

-- Detected processor: x86
-- sizeof(void) = 4 on 64 bit processor. Assume 32-bit compilation mode
CMake Error at cmake/OpenCVDetectCXXCompiler.cmake:195 (message):
OpenCV 4.x requires C++11
Call Stack (most recent call first):
CMakeLists.txt:162 (include)

-- Configuring incomplete, errors occurred!
See also "C:/Users/Kavita/opencv/build_js/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Kavita/opencv/build_js/CMakeFiles/CMakeError.log".
Traceback (most recent call last):
File "./platforms/js/build_js.py", line 227, in
File "./platforms/js/build_js.py", line 167, in config
File "./platforms/js/build_js.py", line 23, in execute
main.Fail: Child returned: 1

All of the programs are set in the system variables. I hope you can provide some guidance.

@nirinsanity
Copy link

Any update to this issue? Is it possible to build opencv.js on Windows 10/11 now?

@alalek
Copy link
Member

alalek commented Nov 19, 2021

possible to build opencv.js on Windows 10/11 now

You can try WSL or Linux VM.

@nirinsanity
Copy link

nirinsanity commented Nov 19, 2021

You can try WSL or Linux VM.

Thanks, I was able to build it on WSL, but it took a lot more time to setup WSL and then build opencv.js. So I was just wondering if there's an easier way to do it right from Windows.

@OliverKulinski
Copy link

OliverKulinski commented Feb 6, 2023

Is it still not possible to build on windows? I'm still having problems

And if not where can i download a new prebuilt version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants