How can I solve this error while making OpenCV3.2 on ubuntu16.04?
I'm trying to compile OpenCV3.2 , but unfortunately I got this error , and I had done lots of work to solve it but failed,.
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_PYTHON_EXAMPLES=ON -D INSTALL_C_EXAMPLES=OFF -D OPENCV_EXTRA_MODULES_PATH=/home/chenzhuo/opencv_contrib/modules -D PYTHON_EXECUTABLE=/usr/bin/python -D BUILD_EXAMPLES=ON ..
[ 84%] Built target example_structured_light_projectorcalibration
[ 84%] Linking CXX shared module ../../lib/cv2.so
/usr/bin/ld: CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o: relocation R_X86_64_PC32 against undefined symbol `_Z13pyopencv_fromIN2cv4MatxIdLi4ELi4EEEEP7_objectRKT_' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
modules/python2/CMakeFiles/opencv_python2.dir/build.make:394: recipe for target 'lib/cv2.so' failed
make[2]: *** [lib/cv2.so] Error 1
CMakeFiles/Makefile2:20459: recipe for target 'modules/python2/CMakeFiles/opencv_python2.dir/all' failed
make[1]: *** [modules/python2/CMakeFiles/opencv_python2.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2