User forums > General (but related to Code::Blocks)
QMouseEvent
(1/1)
der_burner:
Hello together,
i had an Problem with Code::Blocks, qt4 and qtOpenGl.
An easy example from http://mih.voxindeserto.de/threadedcube.html I downloaded and want to build in Code::Blocks. After some Problems to Found the QT Libaries I have only one error. And I don't know how I can solve it.
I get every time the Error Message:
--- Code: ---||=== qt4test, Debug ===|
exampleglwidget.cpp|2|error: QMouseEvent: No such file or directory|
exampleglwidget.cpp||In member function ‘virtual void ExampleGLWidget::mouseMoveEvent(QMouseEvent*)’:|
exampleglwidget.cpp|34|error: ‘class QMouseEvent’ has no member named ‘buttons’|
exampleglwidget.cpp|39|error: ‘class QMouseEvent’ has no member named ‘buttons’|
||=== Build finished: 3 errors, 0 warnings ===|
--- End code ---
Why Code:Blocks couldn't find QMouseEvent?
The Inclue
--- Code: ---#include <QApplication>
--- End code ---
he found, also if I insert the
--- Code: ---#include <qevent.h>
--- End code ---
but then the class QMouseEvent has no member named buttons always displayed.
In KDevelop the same code is build without Errors. But I don't like KDevelop, I want to use Code:Blocks.
Can somebody help me?
MortenMacFly:
--- Quote from: der_burner on January 22, 2010, 09:03:27 am ---i had an Problem with Code::Blocks, qt4 and qtOpenGl.
--- End quote ---
Seeing your error message you don't have a problem with code::blocks, but with the compiler - it is complaining.
--- Quote from: der_burner on January 22, 2010, 09:03:27 am ---Can somebody help me?
--- End quote ---
You most likely missing to set the include path's so the compiler can find all required header files (or it picks the wrong ones in case you setup a wrong include path). To "debug", enable the full compiler log (see my signature) and post again. Please post the full log.
der_burner:
I found the error! The Function buttons() in QMouseEvent don't exists button() is the right one ;)
But now I have an other Problem:
--- Code: ---examplerenderthread.o||In function `ExampleRenderThread::draw()':|
/qt4test/examplerenderthread.cpp|137|undefined reference to `glMatrixMode'|
/qt4test/examplerenderthread.cpp|138|undefined reference to `glLoadIdentity'|
/qt4test/examplerenderthread.cpp|139|undefined reference to `glTranslatef'|
/qt4test/examplerenderthread.cpp|140|undefined reference to `glRotatef'|
/qt4test/examplerenderthread.cpp|141|undefined reference to `glRotatef'|
/qt4test/examplerenderthread.cpp|142|undefined reference to `glRotatef'|
...
...
...
--- End code ---
He's don't finde the OpenGL commands, I found in the Internet I must instert "QT += opengl" in the .pov file, I do! And I must set the additional linker options "-lglui -lglut -lGLU -lGL" but where I do that? When I insert it under Project->Build Options->Linker settings->other Linker options it will don't use!
Build Log:
--- Code: ---g++ -o qt4test exampleglwidget.o examplerenderthread.o main.o -L/usr/share/qt3/lib -L/usr/X11R6/lib -lqt-mt -lXext -lX11 -lm -lpthread
--- End code ---
der_burner:
I see g++ takes "-L/usr/share/qt3/lib" why? He should take QT4 where I can change it?
der_burner:
ok, the solution of all Problems is easy I used qmake instead of qmake-qt4 ;)
Now all is right, Thank you for help
Navigation
[0] Message Index
Go to full version