c++ - QML 中的着色器插件安装

标签 c++ qt qml

我想尝试使用 QML ShaderEffectItem on QGraphicsView

我已经从 https://qt.gitorious.org/qt-labs/qml1-shadersplugin 克隆了文件post中是怎么写的,我已经在~/Dev/GitRepo/qml1-shadersplugin$中编译了这个插件:

使用 QtCreator,编译这个文件:qmlshadersplugin.pro

但现在我在这个文件夹中运行(~/Dev/GitRepo/qml1-shadersplugin): make install

我有很多:错误:

~/Dev/GitRepo/qml1-shadersplugin$ make installcd src/ && make -f Makefile install
make[1]: Entering directory `/home/goran/Dev/GitRepo/qml1-shadersplugin/src'
g++ -c -m32 -pipe -O2 -D_REENTRANT -Wall -W -fPIC -DQT_NO_DEBUG -DQT_PLUGIN -DQT_DECLARATIVE_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../QtSDK/Desktop/Qt/474/gcc/mkspecs/linux-g++-32 -I. -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtCore -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtGui -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL -I../../../../QtSDK/Desktop/Qt/474/gcc/include/QtDeclarative -I../../../../QtSDK/Desktop/Qt/474/gcc/include -I/usr/X11R6/include -I. -o qmlshadersplugin_plugin.o qmlshadersplugin_plugin.cpp
In file included from ../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL/QtOpenGL:5:0,
                 from shadereffectitem.h:46,
                 from qmlshadersplugin_plugin.cpp:43:
../../../../QtSDK/Desktop/Qt/474/gcc/include/QtOpenGL/qgl.h:77:20: fatal error: GL/gl.h: No such file or directory
compilation terminated.
make[1]: *** [qmlshadersplugin_plugin.o] Error 1
make[1]: Leaving directory `/home/igor/Dev/GitRepo/qml1-shadersplugin/src'
make: *** [sub-src-install_subtargets] Error 2

有什么问题?

最佳答案

GL/gl.h: No such file or directory

这意味着您没有安装 opengl 库(极不可能),或者您没有在 qmake 文件中启用它(极有可能)。要在 qmake 文件中启用 opengl,您需要添加这一行:

QT += opengl

更多信息 here .

关于c++ - QML 中的着色器插件安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8318210/

相关文章:

qt - 识别 QLineEdit 是否失去焦点

c++ - Qt:在 QTreeView 中以自定义方式显示文件系统

javascript - QML StackView 替换无内容推送

repeater - 如何为中继器中的属性创建别名?

c++ - UML 中的复杂类型定义

c++ - 在 ResizeToContents 模式下调整大小时,QHeaderView 仅考虑当前屏幕上的项目

java - 如何强制 Java/awt 使用特定的工具包 (qt)?

qt - 如何在 Qt 5.2 QML 应用程序中实现分页

c++ - 在顶点着色器中将法线转换为 View 空间

c++ - 条件变量、互斥锁和锁的区别