在 Windows 7 上编译源 Qt 4.7.4 错误 qmake 不是内部或外部命令
编辑 2 -
我在 /bin 文件夹中没有应用程序文件 qmake,这是我收到的错误。
路径环境变量: C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
命令提示符 - Visual Studio 2005
源文件夹 - C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4
步骤 -
已下载 src
将文件解压到文件夹 – qt-everywhere-opensource-src-4.7.4(C:\development\referencebuilds\qt\4.7.4)
configure.exe -opensource -fast -no-accessibility -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-webkit -no-scripttools -platform win32- msvc2005 -D “_BIND_TO_CURRENT_VCLIBS_VERSION=1”
4.nmake
的错误get 是
Microsoft (R) 程序维护实用程序版本 8.00.50727.762 版权所有 (C) 微软公司。版权所有。
C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7
.4\bin\qmake C:/development/referencebuilds/qt/4.7.4/qt-everywhere-opensource-sr c-4.7.4/\projects.pro -o Makefile -spec win32-msvc2005 'C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\ qmake' 不被识别为内部或外部命令, 可运行的程序或批处理文件。 NMAKE:致命错误 U1077:'C:\development\referencebuilds\qt\4.7.4\qt-everywhere e-opensource-src-4.7.4\bin\qmake' :返回代码 '0x1' 停止。
我知道我的 \bin 文件夹中没有 qmake 的应用程序文件和许多其他应用程序文件。我如何获得它们?
编辑1 好吧,在尝试了所有答案之后,情况仍然如此。我想我应该为我正在做的事情添加更多细节。
我正在从另一台计算机复制 bin 文件(.dll、应用程序、应用程序扩展、增量链接器文件、程序调试数据库),Qt 的版本为 4.7.2
我的问题是 - 1. 您认为这是所有问题的原因吗?如果是,我如何获取上述所有文件?如果我只是按照上面的方式配置然后运行 nmake 我得到
Microsoft (R) 程序维护实用程序版本 8.00.50727.762 版权所有 (C) 微软公司。保留所有权利。
<预><代码> C:\development\referencebuilds\qt\4.7.4\bin\qmakeC:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile -规格 win32-msvc2008 无法识别“C:\development\referencebuilds\qt\4.7.4\bin\qmake” 作为内部或外部命令、可操作程序或批处理文件。 NMAKE:致命错误 U1077: 'C:\development\referencebuilds\qt\4.7.4\bin\qmake' :返回代码 “0x1”停止。
源文件
1、下载名为qt-everywhere-opensource-4.7.4
的
并将其保存在文件夹c:\development\referencebuilds\qt\4.7.4\
2、解压缩 zip 文件并将文件提取到文件夹中
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
3, 从文件夹
c:\development\referencebuilds\qt\4.7.4\qt-everywhere 复制回所有文件-opensource-4.7.4
到 c:\development\referencebuilds\qt\4.7.4\
4,运行
configure.exe -opensource -fast -no-access ssibility -no-qt3support -无多媒体 -无音频后端 -无声子 -无声子后端 -no-webkit -no-scripttools -platform win32-msvc2008 -D “_BIND_TO_CURRENT _VCLIBS_VERSION=1"
5,nmake 现在出现以下错误。
C:\development\referencebuilds\qt\4.7.4\bin\qmake C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile -spec win32-msvc2008 找不到适合您的 mkspec QMAKESPEC(win32-msvc2008) 尝试后:
C:\Qt\4.7.2\mkspecs 处理项目文件时出错: C:/development/referencebuilds/qt/4.7.4//projects.pro NMAKE:致命 错误 U1077: 'C:\development\referencebuilds\qt\4.7.4\bin\qmake.EX E' :返回代码 '0x3' Stop。
我不知道为什么它引用 C:\Qt\4.7.2\mkspecs 。我该如何克服这个错误?究竟发生了什么。今后我该如何预防此类问题?
Edit 2 -
I don't have the application file qmake in the /bin folder and this is the error I am getting.
Path environment variable : C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
Command Prompt - visual studio 2005
Source folder - C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4
Steps -
Downloaded src
Extracted the files to folder – qt-everywhere-opensource-src-4.7.4(C:\development\referencebuilds\qt\4.7.4)
configure.exe -opensource -fast -no-accessibility -no-qt3support -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-webkit -no-scripttools -platform win32-msvc2005 -D “_BIND_TO_CURRENT_VCLIBS_VERSION=1”
4.nmake
The error I get is
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.
C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7
.4\bin\qmake C:/development/referencebuilds/qt/4.7.4/qt-everywhere-opensource-sr
c-4.7.4/\projects.pro -o Makefile -spec win32-msvc2005
'C:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-src-4.7.4\bin\
qmake' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:\development\referencebuilds\qt\4.7.4\qt-everywher
e-opensource-src-4.7.4\bin\qmake' : return code '0x1'
Stop.
I know I dont have the app files for qmake and many other appfiles in my \bin folder. How do I get them?
Edit 1
Well, after trying out all the answers, the situation still remains the same. I think i should add more details to what I am doing.
I am copying bin files(.dll , Appplication, Application Extension, Incremental Linker File, Program Debug Database, ) from another machine and the version of Qt was 4.7.2
My questions are -
1. Do you see that as the cause for all the issues here? If yes, how do I get all the above files? If I just congigure as above and then run nmake I get
Microsoft (R) Program Maintenance Utility Version 8.00.50727.762
Copyright (C) Microsoft Corporation. All rights reserved.C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' is not recognized
as an inte rnal or external command, operable program or batch file.
NMAKE : fatal error U1077:
'C:\development\referencebuilds\qt\4.7.4\bin\qmake' : return code
'0x1' Stop.
1, Downloaded the source file named
qt-everywhere-opensource-4.7.4
and saved it in folder c:\development\referencebuilds\qt\4.7.4\
2, uncompressed the zip file and the files extracted into folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
3, Copied back all files from the folder
c:\development\referencebuilds\qt\4.7.4\qt-everywhere-opensource-4.7.4
to c:\development\referencebuilds\qt\4.7.4\
4, ran
configure.exe -opensource -fast -no-acce ssibility -no-qt3support
-no-multimedia -no-audio-backend -no-phonon -no-phonon- backend
-no-webkit -no-scripttools -platform win32-msvc2008 -D
"_BIND_TO_CURRENT
_VCLIBS_VERSION=1"
5, nmake and now I get the following errors.
C:\development\referencebuilds\qt\4.7.4\bin\qmake
C:/development/referen cebuilds/qt/4.7.4/\projects.pro -o Makefile
-spec win32-msvc2008 Could not find mkspecs for your
QMAKESPEC(win32-msvc2008) after trying:
C:\Qt\4.7.2\mkspecs Error processing project file:
C:/development/referencebuilds/qt/4.7.4//projects .pro NMAKE : fatal
error U1077: 'C:\development\referencebuilds\qt\4.7.4\bin\qmake.EX E'
: return code '0x3' Stop.
I have no clue as to why it is refering to C:\Qt\4.7.2\mkspecs . How do I get over this error? what is exactly happening. How do I prevent such issues in future?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的安装目录是:
我们称之为 $(QTDIR)。现在:
此过程通常会使 Qt 构建正常工作为我。
Your install directory is:
Let's call it $(QTDIR). Now:
This procedure usually gets the Qt build to work for me.
在调用configure 和nmake 之前,请确保您的路径中没有任何现有的QT 目录。
Make sure that you don't have any existing QT directories in your path before you call configure and nmake.
您似乎安装了以前版本的 Qt。 “C:\Qt\4.7.2\”。看起来你已经在系统变量中设置了它。在系统环境变量中查找名为 QTDIR 的变量。这就是为什么你会收到错误,基本上你的 4.7.2 Qt 正在尝试构建新版本。
两个选项:
通过控制面板中的添加/删除软件卸载旧的 Qt。
或
暂时删除 QTDIR 系统变量(需要重新登录),以便当您尝试从源代码构建时,它将使用源文件夹中的正确二进制文件。
然后只需按照以下指南操作:
http://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started /Building_Qt_From_Source
It looks like you have a previous version of Qt installed. "C:\Qt\4.7.2\". And it would seem you have it setup in your system variables. Look for a variable called QTDIR in your system environment variables. Which is why you are getting an error, basically your 4.7.2 Qt is trying to build the new version.
Two options:
Un-install your old Qt via add/remove software in the control panel.
or
Remove your QTDIR system variable for the time being (will require a re-login) so that when you try to build from source it will use the correct binaries from the source folder.
Then just follow this guide:
http://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started/Building_Qt_From_Source