Windows 7中的CodeLite中未显示C ++中cout或printf的输出

Windows 7中的CodeLite中未显示C ++中cout或printf的输出

问题描述:

好的,所以我有一台Windows 7(64)计算机,并下载并安装了CodeLite.尽管我可以很好地使用Visual Studio,但我一直在寻找我准备的教学材料的开源替代品.

Okay, so I have a Windows 7 (64) machine, and I downloaded and installed CodeLite. Although I use Visual Studio just fine, I was looking for an open source alternative for some instructional materials I am preparing.

每次运行程序时,都会弹出一个空白的控制台窗口.窗口中的实际代码永远不会有任何输出.我在另一个州有一个遇到同样问题的同事,他已经使用了很长时间,没有遇到任何问题.如果它是增量构建中的引入错误或类似的东西,那将是一个很大的错误.

Every time I run the program, I get a blank console window that pops up. There is never any output from the actual code in the window. I have an associate in another state who experiences the same problem and he's used it for a long time with no problems. If it's an introduced bug in an incremental build or something, that's a pretty big one.

简单程序:使用printf的默认Hello World程序,如果我将其修改为更像"C ++"(使用cout,包括iostream等),这些程序似乎可以编译,但不会向控制台输出任何内容

Simple programs: the default Hello World program using printf, and also if I modify it to be more "C++" like (using cout, including iostream, etc.) - these appear to compile but do not output anything to the console.

任何建议将不胜感激.我找不到与设置标准输出设备有关的任何设置,您认为应该将其设置为控制台,但是我离题了.

Any suggestions would be greatly appreciated. I can't find any settings related to setting the standard output device, which you'd think would be set to the console, but I digress.

再次感谢!

J

更新:要重现,我只是尝试运行代码.生成->运行,然后选择生成并执行"

更新2:显然在Build中有一个错误,但它仍在运行控制台.我想我需要安装某种mingw工具吗?

C:\Windows\system32\cmd.exe /C mingw32-make.exe -j 8 -e -f  Makefile
'mingw32-make.exe' is not recognized as an internal or external command,
operable program or batch file.
====0 errors, 0 warnings==== **

代码:

#include <iostream>
using namespace std;

int main()
{
    cout<<"Hello World!"<<endl;

    return 0;
}

除了您的编译器问题外什么都没有.

It's nothing but your compiler problem.

从C驱动器中删除mingw编译器文件夹,并下载C ++的TDM GCC编译器,并将TDM GCC编译器安装在相同的codelite目录中.

Remove your mingw compiler folder from C drive and download TDM GCC compiler for C++ and install the TDM GCC compiler in the same directory of codelite.

用于下载编译器的链接: https://sourceforge.net/projects/tdm-gcc/

Link for downloading the compiler: https://sourceforge.net/projects/tdm-gcc/