Building App on Qt 4.8.5 - Missing Directories or Qt Cannot find them
I am a basic app with some Open GL in it, when I add #include <QtOpenGL> or <QGLWidget> to my project, they are under lined in green. I am using qt 4.8.5
When i try to build, it comes up saying:
/home/sam/Project/qt_test_project/geometryengine.h:4: error: QtOpenGL/QGLFunctions: No such file or directory
Please advise on what to do to remove this error, and continue to build my app.
Did you add
QT += openglto your .pro file ?
Yeah, still having the same issue.
@samapollo Did you rerun qmake after adding QT += opengl?
Yeah, and the build fails.
Do I have to set the paths manually?
@SGaist Do I need to build Qt with OpenGL Libraries? Or does a regular cross compile for ARM already come with them, and there is just something wrong with my build/system?
Did you re-run qmake after modifying the .pro file ?
@SGaist Yes I did, and I get the same error.
So I figured out how to fix this issue. In the .pro file add this line:\
INCLUDEPATH = ("/usr/include/qt4")
If you are using a different version of qt, just change the number and/or directory to fit your system and build
Now I am just having issues with QWidget
Again saying it cannot be found.
How did you install that Qt 4.8.5 ?
Also note, that it's pretty old, if you can't go with Qt 5, at least try to go with 4.8.7
Nvm still terminating Saying QtOpenGl is not working.
[main.o] Error 1
Well its a cross compiled qt for ARM on Ubuntu.
I followed this guide:
Should I just reinstall/build for a new version?
No matter what I do I get this stupid QtOpenGL fatal compile error
Did you check the configure summary ?
No, how do I create that?
Now i'm Having and issue with <GL/gl.h> saying it cannot be found.
No more issues with <QtOpenGL/QGLWidget> though.
Not sure what to do here. I have installed everything necessary for OpenGL.
This is my .pro file
Automatically generated by qmake (2.01a) Thu Oct 4 19:01:12 2007
TEMPLATE = app
TARGET = loose_cannon
CONFIG -= app_bundle
DEPENDPATH += .
INCLUDEPATH = /usr/include/qt4
QT += opengl
QT = core gui
QT += gui declarative
QT += widgets
LIBS += -L /usr/lib/ -llibQtOpenGL.so.4.6.2
LIBS += IGL
LIBS += lfreeglut
LIBS += -lglut
LIBS += -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm
SOURCES += main.cpp
SOURCES += glwidget.cpp
SOURCES += mainwindow.cpp
SOURCES += glm.cpp
HEADERS += glwidget.h
HEADERS += mainwindow.h
HEADERS += glm.h
QT += opengl
QMAKE_POST_LINK = cp -R ../loose_cannon/data .;
QMAKE_POST_LINK = xcopy ..\loose_cannon\data*.* data /e;
You have an error in your .pro file. Right after the
QT += openglline you have
QT = core guiwhich resets the content of the variable to
core gui. That's why you can't get the OpenGL module.