PDA

View Full Version : Moc Error: Too many input files specified. Integration Problem?



Daxos
25th November 2010, 09:50
Hi,
I have a really strange problem.

I add a new QObject class I have a moc Error:



#include <QObject>

class Final: public QObject
{
Q_OBJECT
public:
Final();
};



I try to compile this code and this is the error:

>Moc'ing Final.h...
1>moc: Too many input files specified
1>Usage: moc [options] <header-file>
1> -o<file> write output to file rather than stdout
1> -I<dir> add dir to the include path for header files
1> -E preprocess only; do not generate meta object code
1> -D<macro>[=<def>] define macro, with optional definition
1> -U<macro> undefine macro
1> -i do not generate an #include statement
1> -p<path> path prefix for included file
1> -f[<file>] force #include, optional file name
1> -nw do not display warnings
1> @<file> read additional options from file
1> -v display version of moc
1>Project : error PRJ0019: A tool returned an error code from "Moc'ing Final.h..."

if I remove the macro Q_OBJECT compilation is successful (but I can't use SIGNAL and SLOT ;) )


Has anyone had the same problem?


I'm workin in Windows 7 64bit, Qt 4.6.2, Qt Addin 1.1.7, Visual Studio 2005.

tbscope
25th November 2010, 10:53
It's not nice to ask the same question at multiple forums.
http://developer.qt.nokia.com/forums/viewthread/1951/

Daxos
25th November 2010, 11:07
Sorry Tbscope, but I'm not sure that there are the same people.

Lykurg
25th November 2010, 11:18
Try to rebuild your application (e.g. delete your old make file).

Daxos
25th November 2010, 11:25
Try to rebuild your application (e.g. delete your old make file).

I have the same problem :(

I think that can be a wrong vcproj setting because I notided that only in this project (my solution is composed of multiple project) I don't have the visual studio autocomplete.

Daxos
1st December 2010, 14:15
I have solved my problem: the solution is use Qt Addin 1.1.5 instead Qt Addin 1.1.7.

I think that this is a Qt Addin 1.1.7 bug.

budiulik
8th February 2011, 18:06
Hi, I had the same problem and I solved it by making a random change in the Visual Studio project properties. In my case changing the order of the additional include directories did the magic, but I think that any change could work since it seems to me that this issue is caused by a malformed vcproj file.
Hope this helps.
Cheers

jobrandt
18th February 2011, 16:37
Hello, in my installation(VS2008,Qt 4.7.1,Addin 1.1.7) " Files" is added at the end of Command Line In "Custom Build Step" for.h files. This gives the error message.
If i add a .h-file i always have to remove the added "Files".

Does anybody know how to modify the rules that were use to set the parameters in"Custom Build Steps"?

Bye

ndurland
4th March 2011, 15:54
Using the Visual Studio plugin, I found a workaround by going into Qt Project Settings and selecting a new module, compiling, and then going back and deselecting.