• 7140阅读
  • 4回复

使用VS2005编译Qt工程遇到的问题 [复制链接]

上一主题 下一主题
离线tengpi
 
只看楼主 倒序阅读 楼主  发表于: 2009-10-23
我用VS2005编译Qt下的一个工程,出现了如下问题
1>MOC base/mdi_window.h
1>系统找不到指定的路径。
1>Project : error PRJ0019: 工具从"MOC base/mdi_window.h"
请教高手怎么解决
PS:base目录已包含在工程目录内
离线wd007

只看该作者 1楼 发表于: 2009-10-23
还是再把问题说清楚些,什么样的工程等等
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
离线tengpi
只看该作者 2楼 发表于: 2009-10-26
引用第1楼wd007于2009-10-23 22:58发表的  :
还是再把问题说清楚些,什么样的工程等等

使用QT作为用户界面C++应用程序
离线yangfanxing
只看该作者 3楼 发表于: 2009-10-26
配置好了吗???
库的话需要编译个一、2个小时,最后生成工程文件->才能打开->编译运行
PHPWind好恶心。。。不想看这种界面。。。
离线tengpi
只看该作者 4楼 发表于: 2009-10-27
谢谢楼上2位,问题已经解决了,是包含路径太长引起的,这是参考的帖子
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:
快速回复
限100 字节
 
上一个 下一个