PDA

View Full Version : Why do I get this error?



Jeffb
23rd February 2011, 23:23
Hi Guys

I've been building a project from terminal on a Mac and debugging from XCode.

But I decided to try building from QT Creator and debug from there also to save time.
When I try to build from QT I get this error:
:: error: [moc_JBUtilities.cpp] Error 1

Any ideas?

Thanks
Jeff

schnitzel
23rd February 2011, 23:49
I'm not sure how many here have crystal balls, but you might want to show us a bit more so we can help you, i.e. code, project file, build log etc.

Jeffb
24th February 2011, 00:03
Good point:

Using Qt 4.7 on Mac OS 10.6 (Snow Leopard).

Relevant compile output:

new attempt/JBUtilities.h -o moc_JBUtilities.cpp
moc: Too many input files specified
Usage: moc [options] <header-file>
-o<file> write output to file rather than stdout
-I<dir> add dir to the include path for header files
-E preprocess only; do not generate meta object code
-D<macro>[=<def>] define macro, with optional definition
-U<macro> undefine macro
-i do not generate an #include statement
-p<path> path prefix for included file
-f[<file>] force #include, optional file name
-nw do not display warnings
@<file> read additional options from file
-v display version of moc
make: *** [moc_JBUtilities.cpp] Error 1

First part of .h file for JBUtilities:


#ifndef JBUTILITIES_H
#define JBUTILITIES_H

#include <QObject>
#include <QHash>
#include <QBrush>
#include <QMessageBox>
#include "JBConstants.h"

class JBUtilities : public QObject
{
Q_OBJECT

public:
static JBUtilities* getJBUtilities();
QString getTableNameForLabel(const QString &aLabel) const;
QString getLabelForTableName(const QString &aTableName) const;

wysota
24th February 2011, 00:08
You have an unescaped space in your path.

Jeffb
24th February 2011, 00:19
@Wysota

As always you are a great help.
Thanks. You are spot on.

Cheers
Jeff