Results 1 to 4 of 4

Thread: Compilation error with MSVC: Wrong MOC version

  1. #1
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Compilation error with MSVC: Wrong MOC version

    Trying to compile moc_*.cpp files fails with MSVC 2005, gives error:

    This file was generated using the moc from 4.4.3. It
    cannot be used with the include files from this version of Qt.
    (The moc has changed too much.)

    Well, I just don't have and never had anything else but 4.5.1 installed on this machine. Calling
    'moc -v' gives 4.5.1 and the moc_*.cpp have preprocessor commands

    #error "This file was generated using the moc from 4.5.1. It"
    #error "cannot be used with the include files from this version of Qt."
    #error "(The moc has changed too much.)"

    So how in the world can I get errors about 4.4.3? How do I go about it? Calling 'nmake mocclean' and 'nmake clean' doesn't help.

  2. #2
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compilation error with MSVC: Wrong MOC version

    delete all the moc_xxxx.cpp files.

  3. #3
    Join Date
    Jun 2009
    Posts
    3
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Compilation error with MSVC: Wrong MOC version

    Calling 'nmake mocclean' does exactly this. The build directory is totally empty. It still gives the same error.

  4. #4
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Compilation error with MSVC: Wrong MOC version

    search for moc.exe and qmake.exe in your computer.. it is a possiblity that some unfriendly human has touched your pc.

Similar Threads

  1. How to avoid creation of MOC files on each compilation
    By nileshsince1980 in forum Qt Programming
    Replies: 4
    Last Post: 29th May 2009, 08:00
  2. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  3. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  4. Replies: 15
    Last Post: 21st April 2007, 17:46

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.