Building App on Qt 4.8.5 - Missing Directories or Qt Cannot find them
-
Hey
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.Thanks.
-
Hi,
Did you add
QT += opengl
to your .pro file ? -
@samapollo Did you rerun qmake after adding QT += opengl?
-
Did you re-run qmake after modifying the .pro file ?
-
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
-
Well its a cross compiled qt for ARM on Ubuntu.
I followed this guide:
https://forum.qt.io/topic/52546/tuto-build-qt-to-cross-compile-for-arm/2
Should I just reinstall/build for a new version?
No matter what I do I get this stupid QtOpenGL fatal compile error
@SGaist -
Did you check the configure summary ?
-
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 -lmInput
SOURCES += main.cpp
model.cpp
ui/window.cpp
ui/ui.cpp
ui/controller.cpp
ui/cbutton.cpp
node.cpp
ui/hudobject.cpp
ui/radar.cpp
ui/hudicon.cpp
entity.cpp
unit.cpp
tank.cpp
soundbank.cpp
soundthread.cpp
SOURCES += glwidget.cpp
SOURCES += mainwindow.cpp
SOURCES += glm.cpp
HEADERS += glwidget.h
model.h
ui/window.h
ui/ui.h
ui/controller.h
ui/cbutton.h
node.h
ui/hudobject.h
ui/radar.h
ui/hudicon.h
entity.h
unit.h
tank.h
soundbank.h
soundthread.h
HEADERS += mainwindow.h
HEADERS += glm.h
RESOURCES +=
QT += opengl
multimediaunix {
QMAKE_POST_LINK = cp -R ../loose_cannon/data .;
}
win32 {
QMAKE_POST_LINK = xcopy ..\loose_cannon\data*.* data /e;
} -
You have an error in your .pro file. Right after the
QT += opengl
line you haveQT = core gui
which resets the content of the variable tocore gui
. That's why you can't get the OpenGL module.