gpt4 book ai didi

c++ - 从 Eclipse IDE 运行 C++ 应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 14:11:09 32 4
gpt4 key购买 nike

我正在使用 eclipse IDE。我这里有一些基本的源代码,包括头文件。一直在使用 cygwin 作为 C++ 编译器。它编译我的应用程序并且不会产生任何错误。但是我在 IDE 的控制台上看不到输出。当我自己运行可执行文件时,它会产生输出。如何配置 Eclipse IDE 以便将输出重定向到 IDE 的控制台?

这就是我得到的:

15:40:11 **** Incremental Build of configuration Debug for project GetCompiled ****
make all
Building target: GetCompiled.exe
Invoking: Cygwin C++ Linker
g++ -o "GetCompiled.exe" ./Compiling.o
cygwin warning:
MS-DOS style path detected: D:\Aristotelis\C++\GetCompiled\Debug
Preferred POSIX equivalent is: /cygdrive/d/Aristotelis/C++/GetCompiled/Debug
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Finished building target: GetCompiled.exe


15:40:12 Build Finished (took 702ms)

选择要运行的应用程序: enter image description here

我尝试通过选择作为 C++ 应用程序运行来从 IDE 运行 exe 文件,但它没有产生任何输出。最好的问候

最佳答案

Eclipse/CDT 不会在每次构建后自动运行您的应用程序。您需要通过菜单 Run->Open Run->Run 或使用键盘快捷键 Crtl+F11,然后再次检查控制台窗口。

一个高级功能是将您的应用程序设置为构建后事件。为此,转到您的build设置并找到适当的子菜单并在那里键入您的 application.exe 的名称(我现在还没有触手可及的 Eclipse)。使用此设置,应用程序将在每次成功构建后自动启动。如果您进行自动化单元测试,这会派上用场。

关于c++ - 从 Eclipse IDE 运行 C++ 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14218349/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com