在MSVC中找不到QTDIR错误构建项目 [英] QTDIR not found error building project in MSVC

查看:189
本文介绍了在MSVC中找不到QTDIR错误构建项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MSVC 2008 SP1和qt-vs-addin-1.1.2

Using MSVC 2008 SP1, and qt-vs-addin-1.1.2

我在MSVC中有一个预先存在的项目,已经进行了QT'化:在主要方面,我添加了一个QApplciation,现在我的窗口都是QWidget. 我为.qrc和.ui文件添加了自定义构建步骤,并为任何Q_OBJECT头文件添加了"moc"作为自定义构建步骤.

I have a pre-existing project in MSVC that I have QT'ified: In main I added a QApplciation, and my windows are now all QWidgets. I added custom build steps for my .qrc and .ui files and "moc" as a custom build step on any Q_OBJECT header files.

这一切功能-项目将生成并运行,并且XCode上的变体也可以工作.

This all functions - the project builds and runs, and the variant on XCode works too.

但是,我的项目的行为仍然与使用Qt向导创建的项目不同:-即Qt加载项未设置QTDIR构建变量.它也没有在项目上下文菜单中提供任何Qt配置选项-它们全部显示为灰色.

However my project still behaves differently to a project created using the Qt wizard :- Namely the Qt addin does NOT set the QTDIR build variable. Nor does it offer any of the Qt configuration options on the project context menu - they're all greyed out.

我可以通过在环境中设置默认的QTDIR来解决QTDIR问题.但是我想解决Qt插件对项目所做的工作-盯着Qt生成的项目与Visual Studio项目的(xml)vcproj文件,不会发现任何明显迹象表明Qt插件正在寻求治疗该项目正常.

I can work around the QTDIR issue by setting the default QTDIR in my environment. But I would like to resolve what the Qt addin has done to the project - eyeballing the (xml) vcproj file of a Qt generated project vs a Visual Studio project does not reveal any obvious signs of what the Qt-addin is looking for to treat the project properly.

推荐答案

QTDIR作为属性.该文件的扩展名为.vcxproj.user,并且与您的项目文件位于同一目录中,并且具有相同的基本名称.据我所知,除了直接编辑文件外,没有其他方法可以修改,添加或删除QTDIR属性.

QTDIR is added as a Property in the Visual Studio Project User Option file for your project. The file has the extension .vcxproj.user, and is in the same directory and has the same base name as your project file. As far as I can tell there is no way to modify, add or delete the QTDIR property besides directly editing the file.

请注意,此属性可以放在用户选项"文件之外的其他文件中.我将其放在属性表中,因此设置Qt项目所需要做的就是添加属性表.

Note, this property can be put in other files besides the User Option file. I placed it in a property sheet, so all I have to do to setup a Qt project is to add a property sheet.

这篇关于在MSVC中找不到QTDIR错误构建项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆