0

I am doing object detection in images using OpenCV library in Eclipse java. For this I need to create a .vec file using opencv_createsamples utility in command prompt but opencv_createsamples is not getting recognized in Dos prompt.

So I need to configure opencv enabled with TBB with CMake but getting compilation error in CMakeCCompilerId.c and CMakeCXXCompilerId.cpp files in CMakeLists.txt file.

Am I missing something?

Florian
  • 39,996
  • 9
  • 133
  • 149
Shilpa
  • 1
  • 1
  • 1
  • 2
    Welcome to StackOverflow. This error message normally just means that `CMake` was unable to compile a simple test program (one of the first things `CMake` tries while detecting your build environment). Could you please add the complete error message to your question (because the reason for the error is most likely also in the message) and please add the command line `CMake` call you are trying also? General speaking you probably don't have the compiler environment set (see e.g. [Why does Cmake Always Choose GCC?](http://stackoverflow.com/questions/10856952/why-does-cmake-always-choose-gcc)). – Florian Sep 16 '15 at 06:57
  • Thanks Florian. To resolve this error I downloaded these two files and copied them in source folder of opencv. – Shilpa Sep 17 '15 at 05:46
  • But now I am getting another error. The CXX compiler identification is unknown The C compiler identification is unknown CMake Error at CMakeLists.txt:88 (project): No CMAKE_CXX_COMPILER could be found. CMake Error at CMakeLists.txt:88 (project): No CMAKE_C_COMPILER could be found. Configuring incomplete, errors occurred! See also "C:/opencv/build/CMakeFiles/CMakeOutput.log". See also "C:/opencv/build/CMakeFiles/CMakeError.log". – Shilpa Sep 17 '15 at 05:57
  • If we are talking about `CMakeCCompilerId.c` and `CMakeCXXCompilerId.cpp`, those are generated by CMake to test/find the compiler. So no need to download them. Your error message says, `CMake` can't find your C/CXX compiler. What OS and compiler toolchain are you targeting? Does your compiler work outside CMake if called directly? If e.g. `Linux` and `GNU` what does happen if you call `gcc` in a `bash` shell? I get `gcc.exe: fatal error: no input files` `compilation terminated.`, which is good because it did find `gcc` and it's complaining that I didn't gave it any parameters to work with. – Florian Sep 17 '15 at 13:10
  • And please take a look at `CMakeError.log`. There you will find what CMake tried to call. – Florian Sep 17 '15 at 13:16
  • Duplicate to [How to use OpenCv utilities in Command prompt](http://stackoverflow.com/questions/32623586/how-to-use-opencv-utilities-in-command-prompt) – Florian Sep 21 '15 at 18:59
  • 1
    After 4 years. I am having the same issue. the error message `CMAKE_CXX_COMPILER` could not be found` means that it `gcc/g++ `compiler could not be found. You need to set it as `-DCMAKE_CXX_COMPILER=C:/Rtools/mingw_64/bin/g++.exe` – MEdwin Nov 11 '19 at 12:25

0 Answers0