Results 1 to 7 of 7

Thread: Moc.exe

  1. #1
    Join Date
    Oct 2012
    Posts
    13
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Moc.exe

    When I try to compile my QMYSQL driver, I get an error (this is probably only one of many threads on this topic). "'C:\QtSDK\QtSources\4.8.1\bin\moc.exe' is not recognized as an internal or external command, operable program or batch file.". I have checked my BIN folder (C:\QtSDK\4.8.1\bin\) and no moc.exe exists, additionally I have searched my hard drive and it also could not be found.

    Where can I find moc.exe? I have installed the QT SDK and I also have the sources (obviously). It's not present in either folders.

    This whole compilation of MySQL drivers has so far been nothing but dreadful.

    Full output

    Qt Creator 2.4.1
    Based on Qt 4.7.4 (32 bit)
    Windows 7 (Home) x64

  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: Moc.exe

    The binaries for a given version of Qt are under "C:\QtSDK\Desktop\4.8.x\bin" if you installed in the default location. If there is no moc.exe anywhere on your machine then either:
    • You have not installed the Qt SDK at all, or
    • You went out of your way to not install a set of compiled Qt libraries. You can remedy this with the SDK maintenance tool.


    If you installed the SDK correctly then you have a Start Menu item to launch a correctly configured command shell. Use that.

  3. #3
    Join Date
    Oct 2012
    Posts
    13
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Moc.exe

    Hi Chris,

    Thanks again (you solved my last problem too). What you said worked, it just wasn't in the location that the error indicated. Now when I run qmake "INCLUDEPATH+=C:\mysql\MySQL Server 5.5\include" "LIBS+=C:\mysql\MySQL Server 5.5\lib" mysql.pro I get these errors:

    Cannot find file: Server.
    Cannot find file: 5.5\include.
    Cannot find file: Server.
    Cannot find file: 5.5\lib.

    I know it's a problem with spacing in the installation path, however I am unable to change the install directory of a sub feature (MySQL Server 5.5 must be installed in the parent directory). How can I solve this?

  4. #4
    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: Moc.exe

    The spaces in the paths to MySQL are definitely the problem. It's generally a good idea to avoid spaces in paths because a lot of scripts/utilities have issues.

    You try using the short mangled name Windows gave the "MySQL Server 5.5" folder (perhaps MysqlS~1.5, but check):
    Qt Code:
    1. qmake "INCLUDEPATH+=C:\mysql\MySQLS~1.5\include" "LIBS+=C:\mysql\MySQLS~1.5\lib" mysql.pro
    To copy to clipboard, switch view to plain text mode 
    or something like this (no guarantee):
    Qt Code:
    1. qmake "INCLUDEPATH+=$$quote(C:\mysql\MySQL Server 5.5\include)" "LIBS+=$$quote(C:\mysql\MySQL Server 5.5\lib)" mysql.pro
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Oct 2012
    Posts
    13
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Moc.exe

    Thanks Chris, it worked (the last one). Well, off to my next error. This is painful. Why can't MySQL drivers be publicly available by Oracle?

  6. #6
    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: Moc.exe

    The MySQL drivers are publicly available. What you are are building is a small plugin to adapt the interface provided by the MySql drivers to the consistent interface that Qt expects of all SQL drivers: this is part of Qt and nothing to do with Oracle.

  7. #7
    Join Date
    Oct 2012
    Posts
    13
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Moc.exe


  8. The following user says thank you to xyz247 for this useful post:


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.