Home Cannot compile opencv because of missing header files
Reply: 0

Cannot compile opencv because of missing header files

Arnold
1#
Arnold Published in 2017-12-06 11:31:30Z

I am trying to compile opencv on Mint 18.3. I followed the instructions from this site. When I call cmake I get some errors. In the file CMakeError.log I find some entries to some missing files, for example to `libpng:

CheckIncludeFile.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:71: fatal error: /home/arnold/bin/anaconda3/envs/ml-gpu/include/libpng/png.h: No such file or directory
compilation terminated.

However, when I check the file it appears to be present:

(ml-gpu) arnold@orlandus ~/bin/anaconda3/envs/ml-gpu/include $ dir /home/arnold/bin/anaconda3/envs/ml-gpu/include/png.h
lrwxrwxrwx 1 arnold arnold 14 Dec  4 04:49 /home/arnold/bin/anaconda3/envs/ml-gpu/include/png.h -> libpng16/png.h

I got more files missing, all in the same manner. I am sure I installed the development versions, so I do not understand what is wrong. Could someone help me out?

I install this in Anaconda 5.0.1, in a separated (conda) environment (ml-gpu) with numpy, pandas and schikit-learn present.

Below is the complete error log

Determining if the system is big endian passed with the following output:
Change Dir: /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_1d45c/fast"
/usr/bin/make -f CMakeFiles/cmTC_1d45c.dir/build.make CMakeFiles/cmTC_1d45c.dir/build
make[1]: Entering directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_1d45c.dir/TestEndianess.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_1d45c.dir/TestEndianess.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/TestEndianess.c
Linking C executable cmTC_1d45c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1d45c.dir/link.txt --verbose=1
/usr/bin/cc     -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG    CMakeFiles/cmTC_1d45c.dir/TestEndianess.c.o  -o cmTC_1d45c -rdynamic 
make[1]: Leaving directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'

TestEndianess.c:
/* A 16 bit integer is required. */
typedef unsigned short cmakeint16;

/* On a little endian machine, these 16bit ints will give "THIS IS LITTLE ENDIAN."
   On a big endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_little[] =  {0x4854, 0x5349, 0x4920, 0x2053, 0x494c, 0x5454, 0x454c, 0x4520, 0x444e, 0x4149, 0x2e4e, 0x0000};

/* on a big endian machine, these 16bit ints will give "THIS IS BIG ENDIAN."
   On a little endian machine the characters will be exchanged pairwise. */
const cmakeint16 info_big[] =     {0x5448, 0x4953, 0x2049, 0x5320, 0x4249, 0x4720, 0x454e, 0x4449, 0x414e, 0x2e2e, 0x0000};

#ifdef __CLASSIC_C__
int main(argc, argv) int argc; char *argv[];
#else
int main(int argc, char *argv[])
#endif
{
  int require = 0;
  require += info_little[argc];
  require += info_big[argc];
  (void)argv;
  return require;
}


Determining if the include file /home/arnold/bin/anaconda3/envs/ml-gpu/include/libpng/png.h exists failed with the following output:
Change Dir: /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2ac38/fast"
/usr/bin/make -f CMakeFiles/cmTC_2ac38.dir/build.make CMakeFiles/cmTC_2ac38.dir/build
make[1]: Entering directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2ac38.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_2ac38.dir/CheckIncludeFile.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:71: fatal error: /home/arnold/bin/anaconda3/envs/ml-gpu/include/libpng/png.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_2ac38.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_2ac38.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_2ac38.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_2ac38/fast' failed
make: *** [cmTC_2ac38/fast] Error 2


Determining if the include file linux/videodev.h exists failed with the following output:
Change Dir: /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_de91f/fast"
/usr/bin/make -f CMakeFiles/cmTC_de91f.dir/build.make CMakeFiles/cmTC_de91f.dir/build
make[1]: Entering directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_de91f.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_de91f.dir/CheckIncludeFile.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:28: fatal error: linux/videodev.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_de91f.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_de91f.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_de91f.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_de91f/fast' failed
make: *** [cmTC_de91f/fast] Error 2


Determining if the include file sys/videoio.h exists failed with the following output:
Change Dir: /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_02e24/fast"
/usr/bin/make -f CMakeFiles/cmTC_02e24.dir/build.make CMakeFiles/cmTC_02e24.dir/build
make[1]: Entering directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_02e24.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_02e24.dir/CheckIncludeFile.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:25: fatal error: sys/videoio.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_02e24.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_02e24.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_02e24.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_02e24/fast' failed
make: *** [cmTC_02e24/fast] Error 2


Determining if the include file ffmpeg/avformat.h exists failed with the following output:
Change Dir: /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e7a71/fast"
/usr/bin/make -f CMakeFiles/cmTC_e7a71.dir/build.make CMakeFiles/cmTC_e7a71.dir/build
make[1]: Entering directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e7a71.dir/CheckIncludeFile.c.o
/usr/bin/cc    -fsigned-char -W -Wall -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Wformat -Werror=format-security -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wundef -Winit-self -Wpointer-arith -Wshadow -Wno-narrowing -fdiagnostics-show-option -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -mno-avx -msse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -ffunction-sections -fvisibility=hidden  -O3 -DNDEBUG   -o CMakeFiles/cmTC_e7a71.dir/CheckIncludeFile.c.o   -c /home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:29: fatal error: ffmpeg/avformat.h: No such file or directory
compilation terminated.
CMakeFiles/cmTC_e7a71.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_e7a71.dir/CheckIncludeFile.c.o' failed
make[1]: *** [CMakeFiles/cmTC_e7a71.dir/CheckIncludeFile.c.o] Error 1
make[1]: Leaving directory '/home/arnold/bin/opencv/opencv-3.1.0/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_e7a71/fast' failed
make: *** [cmTC_e7a71/fast] Error 2
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300198 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO