Ask Your Question

Revision history [back]

I'm getting a segmentation fault when building my library in Cygwin

Hi all,

I am using Cygwin in Windows 7 and am having some trouble with building my OpenCV library. Here are my steps so far:

  • I downloaded the most recent stable version of the source (3.00)
  • Navigated to my empty desired build directory and called cmake <path to="" the="" source="">
  • Called make from within the build directory
  • This returns an error around 30% that 'close() is not declared in the scope of some function' in system.cpp, so I updated system.cpp to #include <unistd.h>.

This fixed that initial error, however a new error is causing issues now that I cannot seem to resolve. I wonder if my fix to the first issue is causing this seg fault, but I am not sure why it would. Here is the error message I am receiving:

[ 30%] Linking CXX shared library ../../bin/cygopencv_core-3.0.dll
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
compilation terminated.
/usr/lib/gcc/x86_64-pc-cygwin/5.2.0/../../../../x86_64-pc-cygwin/bin/ld: BFD (GNU Binutils) 2.25 assertion fail /cygdrive/i/szsz/tmpp/cygwin64/binutils/binutils-2.25-1.x86_64/src/binutils-gdb/bfd/cofflink.c:264
modules/core/CMakeFiles/opencv_core.dir/build.make:1242: recipe for target 'bin/cygopencv_core-3.0.dll' failed
make[2]: *** [bin/cygopencv_core-3.0.dll] Error 1
make[2]: *** Deleting file 'bin/cygopencv_core-3.0.dll'
CMakeFiles/Makefile2:1269: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

Here is my configuration for my build, if that is helpful:

-- General configuration for OpenCV 3.0.0 =====================================
--   Version control:               unknown
--
--   Platform:
--     Host:                        CYGWIN 2.2.1(0.289/5/3) x86_64
--     CMake:                       3.3.1
--     CMake generator:             Unix Makefiles
--     CMake build tool:            /usr/bin/make.exe
--     Configuration:               Release
--
--   C/C++:
--     Built as dynamic libs?:      YES
--     C++ Compiler:                /usr/bin/c++.exe  (ver 5.2.0)

Thanks in advance! I would really appreciate any help I can get