Ask Your Question
1

Problem building Opencv 3.1 - cap_gphoto2.cpp errors

asked 2016-08-31 11:43:26 -0600

Jenniferwillow gravatar image

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 ... (more)

edit retag flag offensive close merge delete

Comments

Faced with the same problem when building opencv 3.1.0...

wandering gravatar imagewandering ( 2016-09-23 23:42:34 -0600 )edit

2 answers

Sort by » oldest newest most voted
0

answered 2017-01-18 16:26:01 -0600

I had the same exact problem compiling OpenCV 3.1 on CentOS 6.8. I worked around it by disabling gphoto2 in the build by adding the following to the cmake command:

cmake -D WITH_GPHOTO2=OFF

It seems like the cap_gphoto2.cpp file has compilation issues with gcc 4.4.7.

edit flag offensive delete link more
0

answered 2016-09-24 00:03:12 -0600

wandering gravatar image

I set cmake option -DENABLE_PRECOMPILED_HEADERS=ON, the build process works well. Because I use gcc-4.6, while the OFF option needs gcc-6.1 and later.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-08-31 11:43:26 -0600

Seen: 1,069 times

Last updated: Sep 24 '16