Results 1 to 2 of 2

Thread: Proper way to use qmake and moc?

  1. #1
    Join Date
    May 2011
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Proper way to use qmake and moc?

    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

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Proper way to use qmake and moc?

    Without any idea what the source and errors are we cannot really help you.

Similar Threads

  1. No QGraphicsScene proper coordinates
    By harmodrew in forum Newbie
    Replies: 15
    Last Post: 16th November 2010, 12:04
  2. proper use of QList?
    By jhowland in forum Qt Programming
    Replies: 3
    Last Post: 13th September 2010, 14:57
  3. Proper way to clean before re configuring
    By hubbobubbo in forum Installation and Deployment
    Replies: 1
    Last Post: 22nd January 2010, 11:18
  4. Need help determining proper Qt distribution
    By bizmopeen in forum Newbie
    Replies: 2
    Last Post: 22nd December 2009, 20:47
  5. Proper way to #include Qt?
    By pherthyl in forum Qt Programming
    Replies: 1
    Last Post: 11th August 2006, 02:15

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.