我想尝试使用 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/