Code::Blocks:如何在IDE中运行?
当我要求 CodeBlocks 运行我构建的应用程序时,它会生成一个终端窗口并在该窗口中运行应用程序。我该如何让它在 IDE 的日志窗口中运行?
When I ask CodeBlocks to run my built application it spawns a terminal window and runs the application within that window. How do I instead get it to run within the IDE's log window?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是 Code::Blocks 中未实现的东西。
目标可执行文件可以直接从 IDE 运行(无控制台),也可以通过
consolerunner
程序运行,该程序调用任何合适的终端(例如 Windows 下的 cmd,Linux 下的 xterm),并且可以选择在进程已退出。它是哪一个(终端或无终端)取决于项目属性窗口(“构建目标”选项卡)中的“类型”字段。但是,如果您绝对需要,您可以通过作为构建后步骤执行程序来间接获得在日志窗口中运行的效果。在这种情况下,程序的 stdout 和 stderr 都将显示在构建日志选项卡中。
This is something that is not implemented in Code::Blocks as such.
Target executables are either run directly from the IDE (no console), or via the
consolerunner
program which calls whatever terminal is appropriate (e.g. cmd under Windows, xterm under Linux) and optionally prompts for a key once the process has exited. Which one it is (terminal or no terminal) depends on the "Type" field in the project's Properties window ("Build Targets" tab).However, if you absolutely want, you can get the effect of running in the log window indirectly by executing your program as post-build step. In that case, your program's stdout and stderr will both be displayed in the build log tab.