Error in building opencv with ffmpeg
/home/coie/Softwares/Libraries/opencv-2.4.13.3/modules/highgui/src/cap_ffmpeg_impl.hpp:1484:21: error: ‘CODEC_FLAG_GLOBAL_HEADER’ was not declared in this scope c->flags |= CODEC_FLAG_GLOBAL_HEADER;
My solution is to grep the missing defines (2 in total) from FFmpeg by using grep -r which leads to the following code found in libavcodec/avcodec.h:
#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22) #define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER #define AVFMT_RAWPICTURE 0x0020
GCC版本问题:编译找不到 math.h stdlib.h: fatal error: stdlib.h: No such file or director
Error compiling OpenCV, fatal error: stdlib.h: No such file or directory
cmake编译时报错: stdlib.h
fatal error: stdlib.h: No such file or directory
解决方法3
关闭预编译头文件
cmake . -DENABLE_PRECOMPILED_HEADERS=OFF