1

I'm trying to build openCv, I never builded anything before.

I installed gcc in C:\MinGW with ftp://ftp.equation.com/gcc/gcc-7.1.0-64.exe now when I type 'gcc --version' in the command line, I get an awnser.

I then installed CMAKE from https://cmake.org/

I run the GUI and selected my source folder then hit 'configure' that when the error happens.

From my research I should have 'mingw64-make' in my path, it is not because when typing it in the command line produce "not recognized"

I search my drives with UltraSearch and it just returned this :

Name   Path    Size    Last Change File Type
x86_64-w64-mingw32-c++.exe  C:\MinGW\bin\   1,10 MB 11/10/2017  .exe (Application)
x86_64-w64-mingw32-g++.exe  C:\MinGW\bin\   1,10 MB 11/10/2017  .exe (Application)
x86_64-w64-mingw32-gcc-7.1.0.exe    C:\MinGW\bin\   1,10 MB 11/10/2017  .exe (Application)
x86_64-w64-mingw32-gcc-ar.exe   C:\MinGW\bin\   75,00 KB    11/10/2017  .exe (Application)
x86_64-w64-mingw32-gcc-nm.exe   C:\MinGW\bin\   74,50 KB    11/10/2017  .exe (Application)
x86_64-w64-mingw32-gcc-ranlib.exe   C:\MinGW\bin\   74,50 KB    11/10/2017  .exe (Application)
x86_64-w64-mingw32-gcc.exe  C:\MinGW\bin\   1,10 MB 11/10/2017  .exe (Application)
x86_64-w64-mingw32-gfortran.exe C:\MinGW\bin\   1,10 MB 11/10/2017  .exe (Application)

So it look like this mingw64-make is not present in the latest gcc release, what should I do?

Thanks.

Miki
  • 40,887
  • 13
  • 123
  • 202
sliders_alpha
  • 2,276
  • 4
  • 33
  • 52

1 Answers1

2

A make tool – like mingw32-make – is an extra program which is not part of the compiler but is sometimes bundled together with it. In your case it isn’t and you have to get it explicitly.

I’d suggest using the msys2 environment because it allows easy access to everything you need (including the Ninja build system – a make replacement).

From the MINGW64 Shell install via e.g. pacman -S mingw-w64-x86_64-{toolchain,cmake,ninja}.

Then use cmake -G Ninja ….

You will also have mingw32-make.exe, but there is no good reason not to use Ninja with CMake when it’s available.


Alternatively you can obtain a copy of Visual Studio and use the NMake Makefiles… or Visual Studio… generators.

Darklighter
  • 2,082
  • 1
  • 16
  • 21
  • 1
    Another alternative is just to use Windows oriented tools on Windows. By that I mean use Visual Studio Community Edition and just tell CMake to build projects for VS 2017. Use Linux like Linux and use Windows like Windows. It really does make so many things easier. – legalize Oct 12 '17 at 17:18
  • @legalize : I will give it a try, MinGW actually crashed after 48%. I'm not familiar with c++ compilation so I do not know what using windows like windows is. – sliders_alpha Oct 13 '17 at 08:59
  • @legalize Although I agree that VS is another option (i added it to the answer), I don’t know of anything what it would make easier. – Darklighter Oct 13 '17 at 13:18
  • @sliders_alpha Why do you want to build opencv manually in the first place? And in what way did it crash? – Darklighter Oct 13 '17 at 13:19
  • @Darklighter The poster's problem is not finding mingw make in the path. If you use the VS generator, make isn't in the picture and you don't have to fight trying to use a unix oriented tool chain on Windows. – legalize Oct 13 '17 at 16:33
  • @sliders_alpha The 'native' toolchain for building on Windows is Visual Studio (Community Edition is free and fully capable of everything you need to do with C++). The 'native' toolchain for building on unix is cc/make. – legalize Oct 13 '17 at 16:34
  • @Darklighter, at first it crashed because I had to diseable ENABLE_PRECOMPILED_HEADER. now it's crashing for something else. I'm giving up, I didn't knew that MinGW was not supported anymore and that you were suposed to build it with visual studio, I will build it with visual studio. I have to compile it to include some stuff that ins't in the pre-built version, like GIGE camera suport. – sliders_alpha Oct 14 '17 at 15:59
  • @sliders_alpha msys2 also has an opencv package where you could add your the options to the [PKGBUILD](https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-opencv/PKGBUILD), but maybe they are what causes the compilation to crash… It’s sad to hear that it doesn’t work as fluently as it should. – Darklighter Oct 14 '17 at 20:54
  • Where did you get that from, that MinGW isn’t supported? – Darklighter Oct 14 '17 at 20:55
  • @Darklighter http://answers.opencv.org/question/176164/error-during-opencv-330-source-compilation/ first comment on OP question. – sliders_alpha Oct 16 '17 at 10:04