cmake错误:QGLWidget:没有这样的文件或目录 [英] cmake error: QGLWidget: No such file or directory

查看:920
本文介绍了cmake错误:QGLWidget:没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用cmake与Qt,但我得到以下错误时,我建立。

  QGLWidget:没有文件或目录

在我的CMakeLists.txt文件中,我有:

  set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)
qt5_use_modules(SHWidget Widgets)
QtOpenGL 中提到的 pre>

解决方案

$ c>模块文档


警告:除了QGLWidget类,这个模块不应该是
用于新的代码。


< blockquote>

换句话说,您需要向您的构建中添加 QtOpenGL 附加模块。


I am trying to use cmake with Qt, but I get the following error when I build.

QGLWidget: No such file or directory

In my CMakeLists.txt file I have:

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets)
qt5_use_modules(SHWidget Widgets)

解决方案

As noted in the QtOpenGL module docs:

Warning: Apart from the QGLWidget class, this module should not be used anymore for new code.

In other words you need to add the QtOpenGL add-on module to your build.

这篇关于cmake错误:QGLWidget:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆