opencv fails compile on: system.cpp:832:13 - close(fd) not declared in this scope
System is: windows 10, cygwin
[ 33%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/opencl_kernels_core.cpp.o
[ 33%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.sse4_1.cpp.o
/c/_commonShare/opencv-3.4.1/modules/core/src/system.cpp: In function ‘cv::String cv::tempfile(const char*)’:
/c/_commonShare/opencv-3.4.1/modules/core/src/system.cpp:832:13: error: ‘close’ was not declared in this scope
close(fd);
^
make[2]: *** [modules/core/CMakeFiles/opencv_core.dir/build.make:1770: modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1457: modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [Makefile:161: all] Error 2
Anyone faced such a problem before?
" cygwin" -- eww, no real support for that from opencv
g++ --version
?@berak g++ (GCC) 6.4.0
So i'm obligate to use MS's proprietary compiler? What is supported well for windows builds using gcc? mingw?
no, (x86_64-posix-seh-rev1, Built by MinGW-W64 project) 7.2.0) works fine, for me (with a few manual quirks, like adding
#define STRSAFE_NO_DEPRECATE
here)but if you want my 2 ct on it: use mingw, but avoid anything else from cygwin, like their shell.
6.4.0 might not be a bad version, but again cygwin and mingw-64 seem to have fallen apart some time ago, and my advice would be: use the latter, and ditch the former.
@berak , got mingw via the cygwin installer, then configured the via cmake-gui. From 36% it went all the way to 90-something%. The error is
Error: invalid register for .seh_savexmm
, at which point i deem it too-much-voodoo for me. Thanks for the tips, i will keep the mingw - cygwin thing in mind from now on.again, if you want my 2ct: ditch cygwin, entirely. (and your mingw is not my mingw)