Using Qt in Eclipse... without qmake?
-
Hi there,
I'm new around here and decided to just keep lurking the forums until I've now encountered a problem I probably won't be able to fix without any help.
I'm working on a C++ project in Eclipse (educational purposes) and decided to add some nice Qt GUI. This is achieved by using the Debug and Release options in Eclipse with the default g++ compiler. However, when using the Q_OBJECT macro I get 'vtable' errors. After a long time of research I found that all these problems can be led back to qmake, as it apparently makes things a lot easier. However, I don't have the luxury to use qmake in my project as it is not generally accepted in our team and have to be able to manage with just make.
Is there any way I can integrate the Q_OBJECT macro in my project, using the default make? Even though I have the integrated Qt environment installed I code everything manually and don't use it as to make it easier for my team to integrate it into their own Eclipse.
Any help or feedback would be greatly appreciated!
Randomaniac
-
Can you use cmake instead? It has Qt support built-in.
If not, then here is what qmake (roughly) does before make is called:
Run moc (meta-object compiler - that is what parses the Q_OBJECT macro)
Run rcc (resource compiler)
Run uic (parses Qt .ui files and generates corresponding ui_.h headers)
If you want to use make only, you would have to run those tools manually from your makefile, shell script, or just manually :)
-
Thanks a lot! Since I'm stubborn I'll try to include them in my Eclipse (automatically generated) makefile. I should think adding those as compiler flags should suffy. What arguments do they take? I don't have any examples to compare with.. I'll start looking those up for starters, but it'd be great if you could supply me with some kind of example or something I could derive the correct flags from :D.
Next to that I'll give cmake a try, I've only used it for compiling libraries so far.
EDIT: I don't use ui files.. or ui.h files. They confused me, and the examples didn't use them either. Am I wrong to discard them?
-
Uh, I don't know, sorry. I always use qmake, myself. It should be somewhere in the docs. Or in source.
-
Here are some docs on moc and friends:
-
Thanks a lot :D Though I'm hoping I'll only be needing moc since he's the only one complaining.