2017-01-16 11:08:10 -0600 | received badge | ● Notable Question (source) |
2015-12-10 11:21:08 -0600 | received badge | ● Popular Question (source) |
2012-11-16 14:30:17 -0600 | commented question | Initializing static cv::Mat with cv::Mat::zeros causes segmentation fault I tried the version you proposed. But it leads to the same behaviour => segmentation fault during execution. The Problem only occurs if I compile with gcc 4.7.1 with gcc 4.6.2 everything works fine. The problem can also be fixed if you link against dynamic OpenCV libraries. It seems that the initialization of the matrix initializer is finished before the initialization of staticMatTwo in this case. J. |
2012-11-12 03:38:20 -0600 | asked a question | Initializing static cv::Mat with cv::Mat::zeros causes segmentation fault Hi everybody, It is compiled with where {_PATH_TO_OPENCV_} points to the OpenCV installation directory. I both tried the newest version of OpenCV from the git repository as well as the released version 2.4.3. and the released version 2.3.1. All versions have been linked as static libraries. The output of gcc --version is The output of gdb is It compiles and runs fine using gcc version 4.3.2 (Opensuse 11.1) and gcc version 4.6.2 (Opensuse 12.1) in the example is deleted. gets not constructed before the construction of the static instance of the matrix. Does anybody has an idea of how to solve this initialization problem. It would be hard for us not to use a static instance of a cv::Mat in this case. |