ubuntu - 使用cmake的libhand库编译错误

标签 ubuntu cmake ogre libhand

我正在尝试从 libhand.org 构建手部模型库在 Ubuntu 12.04 上。该库使用 ogre 和 opencv 库。我按照作者提供的说明成功安装了 ogre 和 opencv。不幸的是,当使用 cmake(通过命令“cmake ..”)配置 libhand 库本身时,我收到以下错误:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: OGRE_RenderSystem_GL_INCLUDE_DIR (ADVANCED) used as include directory in directory /home/roman/work_dir/libhand-0.9/hand_cpp/source used as include directory in directory /home/roman/work_dir/libhand-0.9/hand_cpp/source/dot_sceneloader
used as include directory in directory /home/roman/work_dir/libhand-0.9/hand_cpp/source/dot_sceneloader/tinyxml

-- Configuring incomplete, errors occurred!

有谁知道为什么会出现这个错误以及可以做什么?

最佳答案

我是libhand库作者和我用 Roman 调试了这个问题。这是此问题的原因和解决方法:

原因:

The OpenGL developer headers/libraries were not installed before OGRE was compiled and then installed.

OGRE 静默编译,但不支持 OpenGL。由于 OGRE 中缺少 OpenGL 支持,因此使用 OGRE 的代码无法编译。


此问题的修复:

1) 通过以下方式安装 OpenGL 开发头文件/库:

sudo apt-get install freeglut3 freeglut3-dev

2) 重新编译/重新安装 OGRE。

使用 libhand 时,重新编译OGRE意味着进入install_help/linux_ogre_static_installer目录并运行:

./install_ogre_static.sh clean

其次是

./install_ogre_static.sh build

sudo ./install_ogre_static.sh install

3) 清理并重新构建 libhand 或报告此错误的其他软件。

对于 libhand,转到 hand_cpp 并执行:

rm -rf build/*

其次是

cd build
cmake ..

完成此步骤后,您应该不会看到报告的错误,希望 libhand 开箱即用。

关于ubuntu - 使用cmake的libhand库编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12037839/

相关文章:

c - recvfrom() 套接字编程 Ubuntu

c - 如何将 add_dependency 与 CMake 一起用于非子目录?

c++ - std::experimental::与ndk/clang一起使用

windows - setx 语法无效

c++ - 如何在 Ubuntu 的共享库中列出导出的函数

python - Pyqt5 MySQL 数据库连接未使用 Python3 通过工作线程打开

c++ - 奇怪的枚举名称冲突

c++ - 如何禁用来自非项目文件的警告? --- Visual Studio 2010

ruby-on-rails - 安装 Heroku Toolbelt Ubuntu 未满足的依赖项

c++ - CMake - 每次构建项目时如何停止构建每个依赖项