简体   繁体   English

通过命令行运行 c++ 应用程序时 Cygwin 和命令提示符之间的区别

[英]Difference between Cygwin and Command prompt when running an c++ application through command line

I have a C++ application that I am trying to run using the Windows command prompt by moving into the application directory and then call appl.exe with some arguments.我有一个 C++ 应用程序,我正在尝试使用 Windows 命令提示符运行,方法是进入应用程序目录,然后使用一些 arguments 调用appl.exe The application gets launched(not yet closed), but the control returns to the command prompt.应用程序启动(尚未关闭),但控件返回到命令提示符。 Now when I do the same on Cygwin terminal, it waits for the application to exit before relinquishing the control.现在,当我在 Cygwin 终端上执行相同操作时,它会等待应用程序退出,然后再放弃控制。

I have tried to search for an answer but was not able to do so.我试图寻找答案,但无法做到。

Can you please help me to understand the difference in behavior?你能帮我理解行为上的差异吗?

Thanks in advance.提前致谢。

Terminals in Windows like CMD and PowerShell launch applications in non-blocking mode (usually called the headless mode, if I'm not wrong. And it holds good for all executable files). Windows 中的终端,如 CMD 和 PowerShell 以非阻塞模式启动应用程序(如果我没记错的话,通常称为无头模式。它适用于所有可执行文件)。 There's nothing to bother until your application is running fine.在您的应用程序运行良好之前,没有什么可打扰的。

Cygwin, on the contrary, provides a Linux-like functionality, and thus follows the blocking nature of launching the application.相反,Cygwin 提供了类似 Linux 的功能,因此遵循启动应用程序的阻塞特性。 That results in the Cygwin terminal to wait for the running application to quit to continue working.这导致 Cygwin 终端等待正在运行的应用程序退出以继续工作。

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

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