当我运行此命令以使用 Python 模块安装 OpenCV
cmake ../ -DCMAKE_BUILD_TYPE=RELEASE
-DCMAKE_INSTALL_PREFIX=/usr/local
-DBUILD_EXAMPLES=ON
-DBUILD_NEW_PYTHON_SUPPORT=ON
-DINSTALL_PYTHON_EXAMPLES=ON
-DPYTHON_EXECUTABLE=/usr/local/bin/python2.7
-DPYTHON_INCLUDE_DIR=/usr/local/include/python2.7/
-DPYTHON_LIBRARY=/usr/local/lib/python2.7/config/libpython2.7.a
-DPYTHON_NUMPY_INCLUDE_DIR=/usr/local/lib/python2.7/site-packages/numpy/core/include/
-DPYTHON_PACKAGES_PATH=/usr/local/lib/python2.7/site-packages/
-DBUILD_PYTHON_SUPPORT=ON
我收到此错误消息。
/usr/bin/ld: /usr/local/lib/python2.7/config/libpython2.7.a(abstract.o): relocation R_X86_64_32
against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/python2.7/config/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/cv2.so] Error 1
make[1]: *** [modules/python/CMakeFiles/opencv_python.dir/all] Error 2
make: *** [all] Error 2
我不明白出了什么问题和错误消息。
有没有人可以告诉我这有什么问题?
顺便说一句,我的操作系统是 CentOS。
我使用 Python2.7.5