简体   繁体   English

从 qmake 执行 Powershell 无限期挂起

[英]Executing Powershell from qmake hangs indefinitely

I am trying to execute a Powershell command from within qmake.我正在尝试从 qmake 中执行 Powershell 命令。 A simplified .pro file looks like this:简化的.pro文件如下所示:

$$system(powershell -NonInteractive -Command \"[long]((date).touniversaltime()-[datetime]'1970-01-01').totalmilliseconds\")

However, running qmake with this file or opening it in QtCreator will create a powershell.exe process which hangs indefinitely.但是,使用此文件运行 qmake 或在 QtCreator 中打开它会创建一个无限期挂起的powershell.exe进程。 Running Powershell from the command line works without problems, the command prints the expected timestamp and exits immediately.从命令行运行 Powershell 没有问题,该命令会打印预期的时间戳并立即退出。

What could be causing this hang and how to resolve it?什么可能导致此挂起以及如何解决它?

Tested on Windows 7 x64 with Powershell version 2.0 and qmake version 3.1 / Qt 5.9.8.在 Windows 7 x64 上使用 Powershell 版本 2.0 和 qmake 版本 3.1 / Qt 5.9.8 进行测试。

Don't use the quote.不要使用引用。 The possible command is:可能的命令是:

$$system(powershell -Command Get-Date -Format "yyyy.MM.dd.HH.mm")

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

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