View Full Version : Moc.exe
xyz247
13th October 2012, 05:08
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 (http://qt-project.org/downloads) 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 (http://pastebin.com/cgCrtfvL)
Qt Creator 2.4.1
Based on Qt 4.7.4 (32 bit)
Windows 7 (Home) x64
ChrisW67
13th October 2012, 07:17
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.
xyz247
14th October 2012, 00:23
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?
ChrisW67
14th October 2012, 07:49
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):
qmake "INCLUDEPATH+=C:\mysql\MySQLS~1.5\include" "LIBS+=C:\mysql\MySQLS~1.5\lib" mysql.pro
or something like this (no guarantee):
qmake "INCLUDEPATH+=$$quote(C:\mysql\MySQL Server 5.5\include)" "LIBS+=$$quote(C:\mysql\MySQL Server 5.5\lib)" mysql.pro
xyz247
14th October 2012, 23:58
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?
ChrisW67
15th October 2012, 01:05
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.
xyz247
15th October 2012, 01:55
http://i49.tinypic.com/1ic1hv.png
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.