opencv GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
参考:https://blog.csdn.net/u010168781/article/details
/81302989
https://blog.csdn.net/QLULIBIN/article/details/84072356
重新安装opencv3.4,在编译时选择GTK版本为 GTK+2
使用cmake命令行:-DWITH_GTK_2_X=ON
直接从原文的这一步开始:
在build文件夹下创建**【修改】**my_cmake.sh文件,文件内容为:
#!/bin/bash
cmake
-D CMAKE_BUILD_TYPE=Release
-D CMAKE_INSTALL_PREFIX=/usr
-D BUILD_PNG=OFF
-D BUILD_TIFF=OFF
-D BUILD_TBB=OFF
-D BUILD_JPEG=OFF
-D BUILD_JASPER=OFF
-D BUILD_ZLIB=OFF
-D BUILD_EXAMPLES=ON
-D BUILD_opencv_java=OFF
-D BUILD_opencv_python2=ON
-D BUILD_opencv_python3=OFF
-D ENABLE_PRECOMPILED_HEADERS=OFF
-D WITH_OPENCL=OFF
-D WITH_OPENMP=OFF
-D WITH_FFMPEG=ON
-D WITH_GSTREAMER=ON
-D WITH_GSTREAMER_0_10=OFF
-D WITH_CUDA=ON
-D WITH_GTK=ON
-D WITH_VTK=OFF
-D WITH_TBB=ON
-D WITH_1394=OFF
-D WITH_OPENEXR=OFF
-D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-9.0
-D CUDA_ARCH_BIN=6.2
-D CUDA_ARCH_PTX=""
-D OPENCV_EXTRA_MODULES_PATH=…/opencv_contrib-3.4.0/modules/
…/
cmake的配置情况可以参考OpenCV官方文档。我做了一些修改,新加了编译contrib模块的内容( -D OPENCV_EXTRA_MODULES_PATH=…/opencv_contrib-3.4.0/modules/ \),删去了opencv_extra的内容。具体配置,各位看官可以根据自己的需要。
接下来,更改my_cmake.sh的执行权限,终端输入:
chmod u+x my_cmake.sh
然后,进入build目录,执行my_cmake.sh文件
cd build
./my_cmake.sh
接下来是很长很长很长的配置时间,配置成功后.
sudo make
sudo make install
配置完成!!!
</div>
<link href="https://csdnimg.cn/release/phoenix/mdeditor/markdown_views-e44c3c0e64.css" rel="stylesheet">
上一篇: Mac上安装MySQL过程分享
下一篇: python构建自定义回调函数详解
推荐阅读
-
opencv GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
-
解决:GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported
-
Gtk-ERROR : GTK+ 2.x symbols detected. Using GTK+2.x and GTK+3 in the same process is not support
-
Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not suppor