gpt4 book ai didi

c++ - 使用 Visual Studio 2010 错误运行 QWT 示例程序(.pro)

转载 作者:搜寻专家 更新时间:2023-10-31 00:36:48 25 4
gpt4 key购买 nike

我在尝试运行 qwt 示例时遇到以下错误,准确地说是 Visual Studio QT 中添加的示波器示例。将出现构建错误,并显示以下行:

1>------ Build started: Project: oscilloscope, Configuration: Debug Win32 ------
1>Build started 3/1/2014 4:57:18 PM.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets(298,5): warning MSB8004: Intermediate Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Intermediate Directory.
1>InitializeBuildStatus:
1> Touching "Win32\Debug\oscilloscope.unsuccessfulbuild".
1>CustomBuild:
1> Moc'ing knob.h...
1> The syntax of the command is incorrect.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 255.
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.05
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

有人知道为什么吗?不确定这个问题是否相关,但是当我从 Visual Studio 打开 qt 项目时,“Qt Visual Studio Add in”的输出显示:

--- (Import): Generating new project of oscilloscope.pro file
--- (qmake) : Using: c:\qt\qt5.1.1\5.1.1\msvc2010\bin\qmake
--- (qmake) : Working Directory: C:\qwt-6.1.0\examples\oscilloscope
--- (qmake) : Arguments: -tp vc "oscilloscope.pro" -o "oscilloscope.vcxproj" QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe

--- (qmake) : Exit Code: 0

Could not parse QTDIR from project file oscilloscope.vcxproj.
--- (Import): Added oscilloscope.vcxproj to Solution

=== Update uic steps ===

=== 0 uic steps updated. ===


=== Update rcc steps ===

=== 0 rcc steps updated. ===

“无法从项目文件 oscilloscope.vcxproj 解析 QTDIR”是否是导致此问题的原因?

所有示例都可以在 qt creator 中运行。只有当我尝试从 Visual Studio 运行时才会出现此问题。

我已经在 qwt 网站上找到了 qt creator 和 MSVC 的正确安装指南。知道为什么会出现这个问题吗?请帮忙。任何意见或建议将不胜感激。

最佳答案

使用子目录时,Visual Studio 加载项中存在错误。在导入之前尝试在 qwt.pro 文件中更改它:

SUBDIRS = \ 
src \
textengines

到:

SUBDIRS = src textengines

然后,再次导入。您还可以使用固定版本的 Visual Studio 插件。

在这里您可以找到 Qt 错误跟踪器上的相应问题:

Qt Visual Studio Add-in 1.1.0 doesn't parse QTDIR correctly in a project with SUBDIRs

关于c++ - 使用 Visual Studio 2010 错误运行 QWT 示例程序(.pro),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20900003/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com