Problem building Opencv 3.1 - cap_gphoto2.cpp errors
I've been running into the same problem with both the release version of 3.1 and the current cloned version of the repository. The problem appears to be in the videoio module when compiling the cap_gphoto2.cpp file. I've run into this issue on two separate computer systems both running RHEL 6.6. Here's the relevant error messages: At the end of the post is the configuration output and the error log.
[ 42%] Building NVCC (Device) object modules/cudafilters/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_row_filter.8uc3.cu.o Building NVCC (Device) object modules/cudafilters/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_column_filter.16uc1.cu.o Building NVCC (Device) object modules/cudafilters/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_row_filter.32sc1.cu.o /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:171: error: ISO C++ forbids initialization of member ‘context’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:171: error: making ‘context’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:171: error: invalid in-class initialization of static data member of non-integral type ‘GPContext’ /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:177: error: ISO C++ forbids initialization of member ‘camera’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:177: error: making ‘camera’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:177: error: invalid in-class initialization of static data member of non-integral type ‘Camera’ /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:181: error: ISO C++ forbids initialization of member ‘rootWidget’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:181: error: making ‘rootWidget’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:181: error: invalid in-class initialization of static data member of non-integral type ‘CameraWidget’ /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:213: error: ISO C++ forbids initialization of member ‘abilitiesList’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:213: error: making ‘abilitiesList’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:213: error: invalid in-class initialization of static data member of non-integral type ‘CameraAbilitiesList’ /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:214: error: ISO C++ forbids initialization of member ‘capablePorts’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:214: error: making ‘capablePorts’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:214: error: invalid in-class initialization of static data member of non-integral type ‘GPPortInfoList’ /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:215: error: ISO C++ forbids initialization of member ‘allDevices’ [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:215: error: making ‘allDevices’ static [-fpermissive] /home/developer/andor_development_stargate/working/opencv/opencv_clone/opencv/modules/videoio/src/cap_gphoto2.cpp:215: error ...
Faced with the same problem when building opencv 3.1.0...