Repository: opencv
Issue: Issues with installing OpenCV JS on Windows 10
Labels: priority: low,category: build/install,category: javascript (js)

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