0

I am fighting with a problem while installing opencv for Code Blocks.

I have installed MinGW with all necessary compilers and I'm trying to build binaries using CMake. I am setting code blocks MinGW makefiles as generator, and I am specyfing c and c++ compilers as x86_64-w64-mingw32-g++ and gcc. Yet I'm getting an error:

CMake Error: Error SetGlobalGenerator called with null
The CXX compiler identification is unknown
The C compiler identification is unknown
Check for working CXX compiler: C:/mingw-w64/mingw64/bin/x86_64-w64-mingw32-g++.exe
Check for working CXX compiler: C:/mingw-w64/mingw64/bin/x86_64-w64-mingw32-g++.exe -- broken
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/CMakeTestCXXCompiler.cmake:44 (message):
  The C++ compiler "C:/mingw-w64/mingw64/bin/x86_64-w64-mingw32-g++.exe" is
  not able to compile a simple test program.
  It fails with the following output:
   Change Dir: C:/openCV/new_build/CMakeFiles/CMakeTmp

  Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe"
  "cmTC_2867a.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
  Microsoft (R) Build Engine version 14.0.25420.1
  Copyright (C) Microsoft Corporation.  All rights reserved.

  Build started 2016-10-12 14:20:38.
  Project "C:\openCV\new_build\CMakeFiles\CMakeTmp\cmTC_2867a.vcxproj" on
  node 1 (default targets).
  PrepareForBuild:
    Creating directory "cmTC_2867a.dir\Debug\".
    Creating directory "C:\openCV\new_build\CMakeFiles\CMakeTmp\Debug\".
    Creating directory "cmTC_2867a.dir\Debug\cmTC_2867a.tlog\".
  InitializeBuildStatus:
    Creating "cmTC_2867a.dir\Debug\cmTC_2867a.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
  ClCompile:
    CL.exe /c /W1 /WX- /O2 /Oy- /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_2867a.dir\Debug\\" /Fd"cmTC_2867a.dir\Debug\vc140.pdb" /Gd /TP /analyze- /errorReport:queue C:\openCV\new_build\CMakeFiles\CMakeTmp\testCXXCompiler.cxx
  TRACKER : error TRK0005: Failed to locate: "CL.exe".  Nie mo�na odnale��
  okre�lonego pliku.
  [C:\openCV\new_build\CMakeFiles\CMakeTmp\cmTC_2867a.vcxproj]


  Done Building Project
  "C:\openCV\new_build\CMakeFiles\CMakeTmp\cmTC_2867a.vcxproj" (default
  targets) -- FAILED.

  Build FAILED.

  "C:\openCV\new_build\CMakeFiles\CMakeTmp\cmTC_2867a.vcxproj" (default
  target) (1) ->
  (ClCompile target) -> 
    TRACKER : error TRK0005: Failed to locate: "CL.exe". Nie mo�na odnale�� okre�lonego pliku. [C:\openCV\new_build\CMakeFiles\CMakeTmp\cmTC_2867a.vcxproj]

      0 Warning(s)
      1 Error(s)

  Time Elapsed 00:00:01.11


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:93 (project)
Configuring incomplete, errors occurred!
See also "C:/openCV/new_build/CMakeFiles/CMakeOutput.log".
See also "C:/openCV/new_build/CMakeFiles/CMakeError.log".

I have path for MinGW bin folder created, yet there's a problem with compiler. I installed windows JDK8.1 (previously in error window it was said that I need to install it).

Eduard Wirch
  • 9,785
  • 9
  • 61
  • 73
  • CMake does not find your C++ compiler. That's unrelated to Java (yet). – usr1234567 Oct 12 '16 at 13:12
  • 1
    Welcome to stackoverflow. Possible duplicate of [CMake Error at CMakeLists.txt:30 (project): No CMAKE\_C\_COMPILER could be found](http://stackoverflow.com/questions/32801638/cmake-error-at-cmakelists-txt30-project-no-cmake-c-compiler-could-be-found). It seems CMake is trying to take the Visual Studio compiler (cl.exe). – Florian Oct 13 '16 at 10:37

0 Answers0