gpt4 book ai didi

opengl - 尝试构建支持 OpenGL 的 OpenCV 2.4.1

转载 作者:太空宇宙 更新时间:2023-11-03 20:40:51 32 4
gpt4 key购买 nike

我正在尝试构建支持 OpenGL 的 OpenCV 2.4.1,但一直失败。我在我的 Ubuntu 11.04 中安装了 OpenGL,像往常一样,libs 在/usr/lib/libGL.so 下。我知道我的 OpenGL 安装是正确的,因为我的 C++ OpenGL 项目可以正常编译、链接和运行。

我按如下方式运行 cmake 命令,因为我想要同时支持 CUDA 和 OpenGL。

/data/OpenCV-2.4.1/build $ cmake -D WITH_OPENGL=ON -D CMAKE_BUILD_TYPE=RELEASE -D WITH_CUDA=ON -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda/ -D BUILD_EXAMPLES=ON -D WITH_TBB=ON ..

这是我从中得到的输出,告诉我 CUDA 被正确检测到,但 OpenGL 没有检测到

-- General configuration for OpenCV 2.4.1 =====================================
--
-- Platform:
-- Host: Linux 2.6.35-32-generic x86_64
-- CMake: 2.8.8
-- CMake generator: Unix Makefiles
-- CMake build tool: /usr/bin/make
-- Configuration: RELEASE
--
-- C/C++:
-- Built as dynamic libs?: YES
-- C++ Compiler: /usr/bin/c++ (ver 4.4.4)
-- C++ flags (Release): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C++ flags (Debug): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- C Compiler: /usr/bin/gcc
-- C flags (Release): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -O3 -DNDEBUG -DNDEBUG
-- C flags (Debug): -Wall -Wno-long-long -pthread -fomit-frame-pointer -msse -msse2 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3
-- Linker flags (Release):
-- Linker flags (Debug):
--
-- OpenCV modules:
-- To be built: calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo python stitching ts video videostab
-- Disabled: -
-- Disabled by dependency: -
-- Unavailable: androidcamera java
--
-- GUI:
-- QT 4.x: NO
-- GTK+ 2.x: YES (ver 2.22.0)
-- GThread : YES (ver 2.26.1)
-- GtkGlExt: NO
-- OpenGL support: NO
--
-- Media I/O:
-- ZLib: /usr/lib64/libz.so (ver 1.2.3.4)
-- JPEG: /usr/lib64/libjpeg.so (ver 62)
-- PNG: /usr/lib64/libpng.so (ver 1.2.44)
-- TIFF: /usr/lib64/libtiff.so (ver 42 - 3.9.4)
-- JPEG 2000: /usr/lib64/libjasper.so (ver 1.900.1)
-- OpenEXR: /usr/lib64/libImath.so /usr/lib64/libIlmImf.so /usr/lib64/libIex.so /usr/lib64/libHalf.so /usr/lib64/libIlmThread.so (ver 1.6.1)
--
-- Video I/O:
-- DC1394 1.x: NO
-- DC1394 2.x: NO
-- FFMPEG: YES
-- codec: YES (ver 54.23.100)
-- format: YES (ver 54.6.100)
-- util: YES (ver 51.54.100)
-- swscale: YES (ver 2.1.100)
-- gentoo-style: YES
-- GStreamer:
-- base: YES (ver 0.10.30)
-- app: YES (ver 0.10.30)
-- video: YES (ver 0.10.30)
-- OpenNI: NO
-- OpenNI PrimeSensor Modules: NO
-- PvAPI: NO
-- UniCap: NO
-- UniCap ucil: NO
-- V4L/V4L2: Using libv4l (ver 0.8.8)
-- Xine: NO
--
-- Other third-party libraries:
-- Use IPP: NO
-- Use TBB: YES (ver 3.0 interface 5000)
-- Use Cuda: YES (ver 4.2)
-- Use Eigen: YES (ver 2.0.15)
--
-- NVIDIA CUDA: (ver 4.2)
-- Use CUFFT: YES
-- Use CUBLAS: NO
-- NVIDIA GPU arch: 11 12 13 20 21 30
-- NVIDIA PTX archs: 11 12 13 20 21 30
-- NVIDIA GPU features: 11 12 13 20 20 30 20
--
-- Python:
-- Interpreter: /usr/bin/python (ver 2.6.6)
-- Libraries: /usr/lib64/libpython2.6.so (ver 2.6.6)
-- numpy: /usr/local/lib/python2.6/dist-packages/numpy/core/include (ver 2.0.0.dev-27befc8)
-- packages path: lib/python2.6/dist-packages
--
-- Documentation:
-- Build Documentation: NO
-- Sphinx: NO
-- PdfLaTeX compiler: /usr/local/texlive/2011/bin/x86_64-linux/pdflatex
--
-- Tests and samples:
-- Tests: YES
-- Performance tests: YES
-- Examples: YES
--
-- Install path: /usr/local
--
-- cvconfig.h is in: /data/OpenCV-2.4.1/build
-- -----------------------------------------------------------------
--
-- Configuring done
-- Generating done
-- Build files have been written to: /data/OpenCV-2.4.1/build

猜猜少了什么?

最佳答案

您可能忘记安装 GTK+ OpenGL Extensions和他们的标题

sudo apt-get install libgtkglext1 libgtkglext1-dev

关于opengl - 尝试构建支持 OpenGL 的 OpenCV 2.4.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11035500/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com