0
votes

I've been trying to build OpenCV-4.5.1 from source with CMake 3.20.0-rc3. I could run mingw32-make after configuring and generating the files from cmake, but this error always pops up when I try to run mingw32-make install.

enter image description here

D:\build1>mingw32-make install
3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/compiler_depend.make:4: *** multiple target patterns.  Stop.
mingw32-make[1]: *** [CMakeFiles\Makefile2:3433: 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/all] Error 2
mingw32-make: *** [makefile:165: all] Error 2

I tried looking through the makefiles shown in the cmd but its really long and I have really no idea what to look into. From the google searches I've done it seems like it's to do with syntax error in the makefiles. Can you guys help me out with this?

Edit: first 5 lines of 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/compiler_depend.make

# CMAKE generated file: DO NOT EDIT!
# Generated by "MinGW Makefiles" Generator, CMake Version 3.20

3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/bio.c.obj: C:/Users/XXXX/Downloads/opencv-4.5.1/3rdparty/openjpeg/openjp2/bio.c \
  C\\:\\Users\\XXXX\\Downloads\\opencv-4.5.1\\3rdparty\\openjpeg\\openjp2\\bio.c \
Please don't post screenshots. They can't be copy/pasted and they can't be searched. Please use copy/paste of the text, and use formatting features to make sure they're legible.MadScientist
Without looking at anything, these packages are most likely intended to be compiled on a UNIX system (Linux or MacOS), not on a Windows system. The error you're seeing is a very common issue trying to use makefiles with Windows-style paths (UNIX paths don't contain drive letters like C: etc.) You should look through the instructions of the package for special instructions compiling on Windows. Most likely you'll need to use cygwin or some other UNIX-based environment, not cmd.com.MadScientist
edited the post to include the error messageAsh
Does it make sense if I give this a try with msys?Ash
"I tried looking through the makefiles shown in the cmd ..." - Please, add to your post the exact line 4 from the file 3rdparty/openjpeg/openjp2/CMakeFiles/libopenjp2.dir/compiler_depend.make (the error message refers exactly to that line).Tsyvarev