简体   繁体   English

配置Qt命令提示符

[英]Configuring Qt Command Prompt

I'd like to run my Qt application as a standalone executable. 我想将我的Qt应用程序作为独立的可执行文件运行。 I know that I have to configure Qt to build static applications to do this and have added the line of code for this to my .pro file but I cannot get the Qt command prompt to work in order to complete the configuration. 我知道我必须配置Qt来构建静态应用程序来执行此操作并将此代码行添加到我的.pro文件中,但是我无法使Qt命令提示符工作以完成配置。

The command prompt mentions I need to call vcvarsall.bat to complete environment setup. 命令提示符提到我需要调用vcvarsall.bat来完成环境设置。 Could I get some pointers on how to get this batch file to run and what other steps I need to complete to build static applications. 我是否可以获得有关如何运行此批处理文件以及构建静态应用程序需要完成的其他步骤的一些指示。 I'm using version 5.3 and the compiler is MSVC 2012. 我使用的是5.3版,编译器是MSVC 2012。

Edit: I've found the vcvarsall.bat file and tried running it by dragging and dropping it into the cmd window but it was not recognised. 编辑:我找到了vcvarsall.bat文件并尝试通过将其拖放到cmd窗口中来运行它,但它无法识别。

To setup your environment using vcvarsall.bat you need to run it like 要使用vcvarsall.bat设置环境,您需要像运行它一样运行它

%COMSPEC% /k "C:\path\to\vcvarsall.bat"

Few simple steps to build static Qt would be: 构建静态Qt的几个简单步骤是:

cd C:\path\to\Qt
configure.exe -static -release
nmake

Explaining how to build static Qt applications is beyond this SO question. 解释如何构建静态Qt应用程序超出了这个问题。 Please proceed to http://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows . 请继续http://qt-project.org/wiki/Build_Standalone_Qt_Application_for_Windows

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM