min max is not a member of std

asked 2016-12-16 10:11:29 -0600

HDaoud gravatar image

updated 2016-12-21 22:13:24 -0600

Hello,

I'm having problems trying to decode h264 video from IP camera, after some search I found it's because ffmpeg, so I downloaded the latest ffmpeg, and tried to link it to openCV but it still showing the old version! I read that this can be solved by recompiling openCV, so while trying to do so, I keep getting the following error: [part of the error, there are other files with same error]:


/home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp: In function ‘float cv::v_reduce_min(const cv::v_float32x4&)’: /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:1011:58: error: ‘min’ is not a member of ‘std’ OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min) ^ /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:998:21: note: in definition of macro ‘OPENCV_HAL_IMPL_SSE_REDUCE_OP_4’ scalartype s0 = scalar_func(buf[0], buf[1]); \ ^ /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:1011:58: error: ‘min’ is not a member of ‘std’ OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min) ^ /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:999:21: note: in definition of macro ‘OPENCV_HAL_IMPL_SSE_REDUCE_OP_4’ scalartype s1 = scalar_func(buf[2], buf[3]); \ ^ /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:1011:58: error: ‘min’ is not a member of ‘std’ OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min) ^ /home/hdaoud/Documents/opencv-3.0.0/modules/hal/include/opencv2/hal/intrin_sse.hpp:1000:12: note: in definition of macro ‘OPENCV_HAL_IMPL_SSE_REDUCE_OP_4’ return scalar_func(s0, s1); \ ^ make[2]: * [modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/opencv_hal_pch_dephelp.cxx.o] Error 1 make[1]: [modules/hal/CMakeFiles/opencv_hal_pch_dephelp.dir/all] Error 2 make: ** [all] Error 2

I found this problem can be solved by adding #include<algorithm> at the top of each header file showing such error, I did so, but the problem persists, also I'm not using visual studio, it's g++5 on ubuntu 14.04,

I appreciate your help! Regards

EDIT1: I have upgraded ubuntu 14.04 to 16.04 and removed build-essentials and reinstalled it, but the problem persists.

The first error is in stl_algobase.h _GLIBCXX14_CONSTEXPR does not name a type then the min max not std members errors.

edit retag flag offensive close merge delete

Comments

1

opencv3.0.0 is already a year old. can you try with latest master, again ?

berak gravatar imageberak ( 2016-12-17 01:24:50 -0600 )edit

I downloaded opencv 3.1 I also upgraded gcc to 6 but still same error, I also tried to update cmake to 3.4.1 but I'm getting errors about fenv.h:

/usr/include/c++/6/fenv.h:58:11: error: ‘::fenv_t’ has not been declared
  using ::fenv_t;
/usr/include/c++/6/fenv.h:59:11: error: ‘::fexcept_t’ has not been declared
  using ::fexcept_t;

etc...

I tried adding using namespace std; to each file showing the std::min std::max errors but it didn't help.

Looking at the errors they are from the following files: std::min and std::max are in the file stl_algobase.h and they are implemented as templates with _GLIBCXX14_CONSTEXPR tag which is from the file c++config.h

that's why I upgraded gcc, but it's not solving the issue!

HDaoud gravatar imageHDaoud ( 2016-12-18 00:23:45 -0600 )edit