cmake error: QGLWidget: No such file or directory

2019-02-24 13:58发布

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)

标签: c++ qt cmake
1条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-02-24 14:17

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.

查看更多
登录 后发表回答