Error while making example fille
-
Hey,
I need to use Qt for a school project, so I downloaded the 6.4.2 version and tried to build the example project the teacher gave us, but I struggled with this error :./glwidget.h:3:10: fatal error: 'QOpenGLWidget' file not found
Note that the error is related to a
#include <QOpenGLWidget>
in a .h file of the project.
I succeed to resolve this error by adding
INCLUDEPATH += /path/to/header/file
to the .pro file, but another error came up :
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1
I tried to add this (with ChatGPT help) on the .pro file :
QMAKE_MACOSX_DEPLOYMENT_TARGET = 12.5 QMAKE_APPLE_DEVICE_ARCHS = arm64 LIBS += -framework QtWidgets -framework QtOpenGL
but it didn't change anything...
When changing arm64 to x86_64, same error :
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
In my despair, I tried to build one of the examples the 6.4.2 Qt version provides :
cd /path/to/Qt/examples/6.4.2/widgets/tools/plugandpaint/app qmake make -config release
And as i was expecting, another error :
ld: library not found for -lpnp_basictools clang: error: linker command failed with exit code 1
I have
QT += openglwidgets
in my .pro file, so the problem is not related to this.
After hours spent on ChatGPT and hours trying to explain my problem to the course assistants, this forum is my last hope before resetting my Mac.
If this can help, I'm on a M2 Macbook Air, version 12.5.
Thank you if you made it this far, hope someone will be able to help me.
-
Hey,
I need to use Qt for a school project, so I downloaded the 6.4.2 version and tried to build the example project the teacher gave us, but I struggled with this error :./glwidget.h:3:10: fatal error: 'QOpenGLWidget' file not found
Note that the error is related to a
#include <QOpenGLWidget>
in a .h file of the project.
I succeed to resolve this error by adding
INCLUDEPATH += /path/to/header/file
to the .pro file, but another error came up :
ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1
I tried to add this (with ChatGPT help) on the .pro file :
QMAKE_MACOSX_DEPLOYMENT_TARGET = 12.5 QMAKE_APPLE_DEVICE_ARCHS = arm64 LIBS += -framework QtWidgets -framework QtOpenGL
but it didn't change anything...
When changing arm64 to x86_64, same error :
ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1
In my despair, I tried to build one of the examples the 6.4.2 Qt version provides :
cd /path/to/Qt/examples/6.4.2/widgets/tools/plugandpaint/app qmake make -config release
And as i was expecting, another error :
ld: library not found for -lpnp_basictools clang: error: linker command failed with exit code 1
I have
QT += openglwidgets
in my .pro file, so the problem is not related to this.
After hours spent on ChatGPT and hours trying to explain my problem to the course assistants, this forum is my last hope before resetting my Mac.
If this can help, I'm on a M2 Macbook Air, version 12.5.
Thank you if you made it this far, hope someone will be able to help me.
@ferocito Please don't double post!
You already asked exact same question here: https://forum.qt.io/topic/143314/error-while-making-example-file?_=1677748372737 -
S SGaist locked this topic on