PDA

View Full Version : QT Eclipse Integration



qtvision25
10th January 2009, 17:09
Hi all, i have downloaded and installed "QT Eclipse Integration 1.4.3". All is ok when i start a QT Gui project.
But when i start an empty C++ project, i get many errors. For example i have run the Image Viewer example http://doc.trolltech.com/4.4/widgets-imageviewer.html and got a bunch of errors like "error: ISO C++ forbids declaration of `Q_OBJECT' with no type" etc.
I have added the include paths "C:\Qt\4.4.3\include\Qt", "C:\Qt\4.4.3\include\QtGui", "C:\Qt\4.4.3\include\QtOpenGL", "C:\Qt\4.4.3\include\QtCore" and added libraries "libQtCore4", "libqtmain", "libQtGui4" to the project.
What may be wrong with my project settings?
Best Regards,

jpn
10th January 2009, 17:20
It might not be enough to add necessary include paths and linking rules. Qt projects tend to need a set of compiler defines and special makefile rules for moc & friends. Isn't there a way to import a Qt project from a .pro file?

qtvision25
10th January 2009, 17:23
Well, i was thinking to develop an image processing application on my own, and just wanted to start a regular C++ project. So, do you mean that i should always start a "Qt Gui" or "Qt Console" project to successfully utilize QT library?

rexi
10th January 2009, 17:48
You could probably get away with creating a plain C++ project, but you would have to do all the Qt-specific compiler settings etc yourself. Just use the Qt projects. After all, they are provided to make your life easier ;)

qtvision25
10th January 2009, 17:54
Yesterday when i started a QT Gui project, it was good till i wanted to add another 3rd party library to my project(OpenCV). I wasnt be able to link OpenCV libraries properly. But when i start a regular C++ project, i can do that.

rexi
10th January 2009, 19:31
Frankly, I am not very familiar with how stuff like that is done with Eclipse, I haven't used CDT or the Qt Eclipse Integration much. I have tested it, tried to use it for a while, but found that I still like KDevelop better for these tasks ;) Eclipse is a great Java/J2EE IDE, but I just can't get used to it for any other tasks. But probably some in this forum can help you with that problem, adding third party libraries is not an uncommon requirement and I would be very astonished if Eclipse Integration wasn't able to do so. If it was, it would certainly be worth a bug report.

Besides, have you tested Qt Creator? Note that I don't promise you that adding third party libraries will work, as I have only tested it briefly, too, before returning to KDevelop, but it seems to be the way the Trolls are going at the moment, and if it doesn't work a bug report should really get them going there ;)

qtvision25
11th January 2009, 18:41
Man its so weird that i cant debug the project!! ok i have set up a Qt gui project and it builds fine, it also runs fine , but it wont debug ! the error is
Error creating session
Process Terminated
Process Terminated
Process Terminated

;);)

qtvision25
12th January 2009, 23:35
Hi, i have changed the GDB version from 6.8 to 6.6 and its ok now..