简体   繁体   中英

no console output in eclipse C/C++

I am trying to brush up on my C++ Skills, which I haven't used since college. Apparently I am so rusty, that I can't even get a normal Hello World to run: When I open the Hello World Template and Build it, it compiles just fine, but when I run it, there's no output on the console.

This seems to be a known bug that appeared around 2010, but I don't think it has never been fixed in 4 years. To make it work, so far I have tried: Uninstalling the 64-Bit Versions and installing the 32-Bit versions and added C:\\cygwin\\bin to my PATH Variable. Also I have added

setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);

But it tells me, it can't resolve stevbuf. What do I need to include, to make this work?

I tested executing the program in the console, which worked just fine, and I also Added a beep, which didn't play in eclipse, but worked just fine in the console.

Here's the software versions I use: Windows 7 64-Bit Cygwin 32-Bit 2.850

Eclipse IDE for C/C++ Developers Version: Kepler Service Release 2 Build id: 20140224-0627

What else could I test? Any help is greatly appreciated.

Best regards, Pete

For the past couple of days I have been using the command line to run my programs. However, today I noticed, that tere is an Output now in the console in Eclipse.

I'm not sure which of the things I tried did the trick, but it wasn't adding:

setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);

I tried commenting it out and it kept working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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