Results 1 to 3 of 3

Thread: moc related errors

  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Question moc related errors

    hi i am using QGLWidget() for dispalying images
    now i want to use signals and slots
    my class defination is in same main class so i created a moc file using :
    moc -o filename.moc filename.cpp
    and then i included the filename.moc file in the main class file
    then i give qmake command and then make but now it is showing some syntax error in filename.moc in classname function
    what might be the problem plz help me

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: moc related errors

    Don't use moc manually. If you add the Q_OBJECT macro in the class header, moc should be run automatically.

  3. #3
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: moc related errors

    and then i included the filename.moc file in the main class file
    If you are duing it manually, it would be better to add filename.moc to the compile chain, rather then include in code.
    then i give qmake command and then make but now it is showing some syntax error in filename.moc in classname function
    If you can show us the error output it would be much better.

Similar Threads

  1. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  2. Qt Compile Errors?
    By magikalpnoi in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2006, 22:18
  3. Qt 4.1.0 - static examples run with errors!
    By Elder Orb in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2006, 09:40

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
  •  
Qt is a trademark of The Qt Company.