• 20177阅读
  • 4回复

PRj0019问题 A tool returned an error code from "Moc'ing viewSpace.h..." [复制链接]

上一主题 下一主题
离线米尔利安
 

只看楼主 正序阅读 楼主  发表于: 2008-04-11
— 本帖被 XChinux 执行加亮操作(2008-04-11) —
详细的错误信息如下:


Qt meta object compiler
moc: Too many input files specified
Usage:  moc [options] <header-file> -o file  Write output to file rather than stdout -i      Do not generate an #include statement -f[file] Force #include, optional file name -p path  Path prefix for included file -k      Do not stop on errors -nw      Do not display warnings -v      Display version of moc
Project : error PRJ0019: A tool returned an error code from "Moc'ing viewSpace.h..."

Build log was saved at "file://f:\Bitk\source\bitkPlatform\Debug\BuildLog.htm"
bitkApp - 1 error(s), 0 warning(s)

程序是别人做的,很大的一个包,在导师的机器上已经编译通过,到我这儿就出错(- -|||)

用的是VS.net 2003 QT版本是 3.1.2

哪位知道是什么地方出了问题吗?VS里已经在c++ directiores里分别添加了QT的 include bin lib文件夹了……
我们在天上的父,愿人都尊你的名为圣。
愿你的国降临。
愿你的旨意行在地上,如同行在天上。
离线tengpi
只看该作者 4楼 发表于: 2009-10-27
引用第2楼zncggaofei于2008-04-11 22:14发表的  :
转载:http://lists.trolltech.com/qt-interest/2007-10/thread00075-0.html
Message 1 in thread
Subject: Moc error in Visual Studio
.......

Thanks!
离线米尔利安

只看该作者 3楼 发表于: 2008-04-12
多谢楼上的大人帮忙解答~v~

偶素刚刚接触QT的新人……按照大大的说法用命令行已经能生成moc过的文件,但素程序还是不能正常运行……还是以前的问题……我不了解这个moc是如何被VS调用的,不解决调用问题不能正常工作……


Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.

C:\Documents and Settings\Millieen.C7084E4093D6483>cd c:\bitk\source\bitkplatfor
m

C:\BITK\source\bitkPlatform>"C:\Qt\3.1.2Evaluation"\bin\moc viewSpace.h -o moc_viewSpace.cpp
Qt meta object compiler
moc: Too many input files specified
Usage:  moc [options] <header-file>
        -o file  Write output to file rather than stdout
        -i      Do not generate an #include statement
        -f[file] Force #include, optional file name
        -p path  Path prefix for included file
        -k      Do not stop on errors
        -nw      Do not display warnings
        -v      Display version of moc

C:\BITK\source\bitkPlatform>


命令行中如果路径加了引号就不能执行了……("C:\Qt\3.1.2Evaluation"\bin\moc viewSpace.h -o moc_viewSpace.cpp)

build log记载的问题是这样的:

Creating temporary file "f:\Bitk\source\bitkPlatform\Debug\BAT000016.bat" with contents
[
@echo off
"C:\Qt\3.1.2Evaluation"\bin\moc viewSpace.h -o moc_viewSpace.cpp

if errorlevel 1 goto VCReportError
goto VCEnd
:VCReportError
echo Project : error PRJ0019: A tool returned an error code from "Moc'ing viewSpace.h..."
exit 1
:VCEnd
]
Creating command line "f:\Bitk\source\bitkPlatform\Debug\BAT000016.bat"


看来还是要用命令行手动一个一个生成了……


继续含泪跪谢大人~~~
[ 此贴被米尔利安在2008-04-12 13:08重新编辑 ]
我们在天上的父,愿人都尊你的名为圣。
愿你的国降临。
愿你的旨意行在地上,如同行在天上。
离线zncggaofei
只看该作者 2楼 发表于: 2008-04-11
转载:http://lists.trolltech.com/qt-interest/2007-10/thread00075-0.html

Message 1 in thread

Subject: Moc error in Visual Studio
From: "Jim Bancroft" <babbaloo@xxxxxxxxxxx>
Date: Wed, 3 Oct 2007 14:52:59 -0700
Delivered-to: qt-interest@trolltech.com
List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
List-post: <mailto:qt-interest@trolltech.com>
List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
Resent-from: qt-interest@xxxxxxxxxxxxx
Resent-message-id: <hnBCb.A.yvH.-8ABHB@esparsett>
Resent-sender: qt-interest-request@xxxxxxxxxxxxx
To: qt-interest@xxxxxxxxxxxxx

Hi everyone,

This error I'm getting from VS 2005 is a little vague to me, would anyone
have an insight as to where to start? The main Qt project compiles but when
it comes time to moc, this appears:

Moc'ing TextureViewer.h
The system cannot find the path specifiied
'Project : error PRJ0019: A tool returned an error code from "Moc'ing
TextureViewer.h..."

Any starting points? I get this too, not sure if it's related to the above:


BSCMAKE: error Bk1506: cannot open file '.\Debug\DirectionVector.sbr: no
such file or directory


--
[ signature omitted ]


--------------------------------------------------------------------------------
Message 2 in thread

Subject: RE: Moc error in Visual Studio
From: "Ben Shaw" <ben.shaw@xxxxxxxxxx>
Date: Thu, 4 Oct 2007 13:34:13 +1000
Delivered-to: qt-interest@trolltech.com
Importance: Normal
List-help: <mailto:qt-interest-request@trolltech.com?subject=help>
List-post: <mailto:qt-interest@trolltech.com>
List-subscribe: <mailto:qt-interest-request@trolltech.com?subject=subscribe>
List-unsubscribe: <mailto:qt-interest-request@trolltech.com?subject=unsubscribe>
Resent-from: qt-interest@xxxxxxxxxxxxx
Resent-message-id: <rpuHf.A.OTC.UBGBHB@esparsett>
Resent-sender: qt-interest-request@xxxxxxxxxxxxx
Thread-index: AcgGB9gXgmt11/NvSrypN9hRgn5hPwALrVOQ
To: <qt-interest@xxxxxxxxxxxxx>

I have ran across this problem several times before and from what I can tell
and have been told by others the problem seems to come from having to long a
include path and VS somehow cropping it before sending to the MOC'er

I have found a couple of solutions:

1. Check your includes. Remove any that are unnescessary or repeated

2. Change your wokring directory to a location with a shorter file path
(i.e. work from C:\)

3. Manually Moc the file and see if you have any errors
%QTDIR%\bin\moc.exe -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT
-DTESTING_ENABLED -DTRACE_ON -D_DEBUG -D_X86 -DQT_DLL -DQT_GUI_LIB
-DQT_CORE_LIB -DQT_THREAD_SUPPORT "Interface\fileName.h" -o
"Intermediate\Debug\moc_fileName.cpp"





Check the custom build steps of the file in question. Make sure you have
the proper paths to your Qt installation setup in the Qt Addin and/or Qt
Integration for Visual Stdudio 2005.


PRJ0019 means there is an error for a custom build step/event, but it's
confusing, because you get it for syntax errors in your header files. To
see the error, you have to go to the Output window and look for the line
number, something like this:



--------------------------------------------------------------------------------
[ 此贴被zncggaofei在2008-04-11 22:20重新编辑 ]
There is someone that is coming or passing away in your life around the clock, so you may lose sight of those seen, and forget those remembered. There is gain and loss in your life, so you may catch sight of those unseen, and remember those forgotten. Nevertheless, doesn’t the unseen exist for sure? Will the remembered remain forever?
离线zncggaofei
只看该作者 1楼 发表于: 2008-04-11
好像是你的moc的用法不对
There is someone that is coming or passing away in your life around the clock, so you may lose sight of those seen, and forget those remembered. There is gain and loss in your life, so you may catch sight of those unseen, and remember those forgotten. Nevertheless, doesn’t the unseen exist for sure? Will the remembered remain forever?
快速回复
限100 字节
 
上一个 下一个