PDA

View Full Version : Proper way to use qmake and moc?



mossen
6th May 2011, 01:38
Hi, I just started using Qt today. Version 4.7.2. I use Windows, and I'm just doing a tutorial app - 1 class only. I'm having trouble compiling using qmake, nmake, and moc. I can get my program to compile when I moc my source manually and paste it into my cpp file. But I was under the impression that qmake is supposed to take care of this for me.

So, I started with just my source and I did
qmake -project
qmake
nmake

nmake fails with linker errors related to Q_OBJECT. Without Q_OBJECT everything is fine. I don't want to have to paste moc code every time I change things around. What am I doing wrong?

mossen

ChrisW67
6th May 2011, 02:52
Without any idea what the source and errors are we cannot really help you.