|
Re: No Console Output (MinGW, CDT) [message #629932 is a reply to message #629872] |
Thu, 30 September 2010 02:44   |
Eclipse User |
|
|
|
I posted about the same problem approx a week ago.
No one has any clue on how to fix it?
I'm curious though. Are you running all 64 bit stuff (Windows, Java, Eclipse) or 32 bit? The reason I ask is because everything worked fine for me on my old laptop when it was all 32 bit. Now on this laptop, it's all 64 bit and no console output.
|
|
|
Re: No Console Output (MinGW, CDT) [message #629941 is a reply to message #629932] |
Thu, 30 September 2010 05:25   |
Eclipse User |
|
|
|
I am running all 64-bit installations (Windows 7, Java SDK, Eclipse IDE).
What has me confused, though, is how C programs output just fine, but C++ fails to show any response in the console.
I might try to bump down to 32-bit Eclipse/Java installations and see how that fairs.
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #630135 is a reply to message #629872] |
Thu, 30 September 2010 18:04   |
Eclipse User |
|
|
|
It worked.
Here's what i did:
[1] Uninstall
- Removed all traces of Eclipse (64-bit).
- Removed all traces of MinGW (and/or Cygwin).
- Removed all traces of Java (SDK and JRE).
[2] Restart PC
[3] Install
- Installed latest Java JDK (includes the JRE) 32-bit.
- Installed Eclipse IDE (Java Edition) 32-bit.
- Installed MinGW (with Msys).
- Installed the necessary CDT tools from within Eclipse.
And it works fine!
For installation compiler/CDT installation, i followed this guide (making my own alterations where needed):
http://max.berger.name/howto/cdt/cdt.jsp
Hope it works for you! And thanks for the tip-off that it was working 100% on a 32-bit machine.
|
|
|
Re: No Console Output (MinGW, CDT) [message #630143 is a reply to message #630135] |
Thu, 30 September 2010 19:01   |
Eclipse User |
|
|
|
Thank you for this solution, friend.
I also had the same problem, and now it is fixed. I must note, however, that all I had to do was download the 32-bit version of Eclipse C++. Replacing the 64-bit JDK with the 32-bit one was not necessary 
Also, there are a few weird additional symptoms you might have not noticed. Eg, the program does run but it terminates with a very large negative number instead of 0. Also, debugging the program partially works in that it does show the output when I move step by step, but then it breaks down when I try to enter input.
[Updated on: Thu, 30 September 2010 19:07] by Moderator Report message to a moderator
|
|
|
Re: No Console Output (MinGW, CDT) [message #630267 is a reply to message #629872] |
Fri, 01 October 2010 11:24   |
Eclipse User |
|
|
|
I have the EXACTLY same problem.
I am using 32-bit desktop and 64-bit laptop (with projects synchronized between these 2 machines).
Running C Hello world on 32-bit produces outputs as it sould. Running the same program on 64-bit produces no output whatsoever.
If I use 32-bit version on 64-bit Windows (laptop), everything works fine.
Maybe we should fill a bug in bugzilla... Or is it a known problem with known fix?
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #636493 is a reply to message #630135] |
Mon, 01 November 2010 15:14   |
Eclipse User |
|
|
|
I encountered the exact same problem.
Stack:
Windows XP
MinGW
Eclipse Helios CDT
I downloaded and installed mingw, and confirmed it was working from the command line. Then downloaded and unzipped Eclipse Helios CDT and ran it. Opened the help menu and did the CDT Hello World tutorial. Upon running the application, got no console output. Upon running HelloWorld.exe from the command line outside Eclipse, it ran fine and had output.
Google brought me to this thread. Upon seeing the comment about reinstalling and rebooting, I rebooted (did NOT reinstall). Post-reboot, the C++ console output works. No idea why.
|
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #637571 is a reply to message #629872] |
Sun, 07 November 2010 00:05   |
Eclipse User |
|
|
|
I have a 32-bit environment (Win XP, JDK 1.6_20, Eclilpse 3.6.1, Cygwin gcc 4.5.0 and CDT 7.0.1) and I am having the same problem.
I can see the stdout after a flush(cout) call, but this only works under debugger. Nothing is output to the console when I simply run (Ctrl+F11) the application (the "Hello world" one) from Eclipse. To add insult to injury, all of my stderr output is now completely gone. Even flush(cerr) doesn't help (although flushing is redundant anyway since stderr is unbuffered). stderr is not available neither in Debug nor Run modes. This is very sad, to say the least...
In the Eclipse log I see some java.io.IOException: Pipe closed exceptions that seem to correspond to my debug runs.
Has anyone figured out how to solve this problem or reported a bug?
|
|
|
Re: No Console Output (MinGW, CDT) [message #642689 is a reply to message #629872] |
Thu, 02 December 2010 11:36   |
Eclipse User |
|
|
|
I use Linux for developing software, but recently
I've got Eclipse Helios installed on Windows 7 64bit
for some project. I've installed MinGW and gdb.
In the command line can I see the program output
result but that is not the case with console inside
Eclipse. Hasn't this issue been fixed yet?
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #643081 is a reply to message #630143] |
Sat, 04 December 2010 01:15   |
Eclipse User |
|
|
|
Hi, I've just tried the workaround method mentioned above.
But it still doen't work. Could you be more specific on the procedures?
I use 64 bit JDK and installed Helios Eclipes 32bit which failed to
find the jre although it was in the PATH so I copied the jre folder into
Eclipse. It opens but fails to output in the console. Of course I did this on
Windows 7 64bit.
|
|
|
Re: No Console Output (MinGW, CDT) [message #643238 is a reply to message #643081] |
Mon, 06 December 2010 08:32   |
Eclipse User |
|
|
|
Sunghyun wrote on Sat, 04 December 2010 02:15 |
Hi, I've just tried the workaround method mentioned above.
But it still doen't work. Could you be more specific on the procedures?
I use 64 bit JDK and installed Helios Eclipes 32bit which failed to
find the jre although it was in the PATH so I copied the jre folder into
Eclipse. It opens but fails to output in the console. Of course I did this on
Windows 7 64bit.
|
Eclipes 32bit needs a 32Bit JRE/JDK!
|
|
|
Re: No Console Output (MinGW, CDT) [message #647424 is a reply to message #629872] |
Thu, 06 January 2011 09:06   |
Eclipse User |
|
|
|
I encountered similar problem.
Enviroment:
jdk1.6u18 64bit + Eclipse Helios 64bit + win7 64bit
No console output at "Run", but output correctly at "Debug".
The following method worked for me:
1 Goto Project->Properties->Run/Debug Settings, choose the .exe file and press "Edit"
2 In the "Environment" tag, press "New", set it as:
"Name:PATH"
"Value:C:\MinGW\bin"
In fact, I have already set "C:\MinGW\bin" in windows PATH environment variable, but it samed not work......
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #649727 is a reply to message #629872] |
Thu, 20 January 2011 13:00   |
Eclipse User |
|
|
|
Hi,
I am running 64-bit Eclipse (W7 64bit, jdk 1.6 64bit) and was
having the same issue. I tried the FAQ suggestion but didn't
work, as well as flushing manually.
I was getting output if I debugged the app, though. What I did
was head to the location pointed above:
Project Properties -> C/C++ Build -> Settings -> Tool Settings
And from there I noticed (Tool Chain Editor) that the project was using Cygwin for building (I had tried it but couldn't get everything set up right, so I switched to Mingw afterwards, or so I thought lol). Changing to Mingw I got console output without having to revert to 32bit on eclipse/jdk.
No -static flag or additional path settings were set up either.
So in a nutshell, changing to MinGW and ensuring it is used for the current project was what fixed it for me, hope it helps somebody.
Edit: haven't tested for C++ output / cout
[Updated on: Thu, 20 January 2011 20:03] by Moderator Report message to a moderator
|
|
|
Re: No Console Output (MinGW, CDT) [message #659377 is a reply to message #647424] |
Sun, 13 March 2011 04:51   |
Eclipse User |
|
|
|
This worked for me...
I also have the location of the MingW Complier in my systems PATH variable however no output in Eclipse's console. Program complies fine and executes correctly on the command-line but not within Eclipse. I added the variable AGAIN in this location and it began working. I can now see output.
|
|
|
Re: No Console Output (MinGW, CDT) [message #661370 is a reply to message #647424] |
Thu, 24 March 2011 12:23   |
Eclipse User |
|
|
|
No Real Name wrote on Thu, 06 January 2011 04:06 | I encountered similar problem.
Enviroment:
jdk1.6u18 64bit + Eclipse Helios 64bit + win7 64bit
No console output at "Run", but output correctly at "Debug".
The following method worked for me:
1 Goto Project->Properties->Run/Debug Settings, choose the .exe file and press "Edit"
2 In the "Environment" tag, press "New", set it as:
"Name:PATH"
"Value:C:\MinGW\bin"
In fact, I have already set "C:\MinGW\bin" in windows PATH environment variable, but it samed not work......
|
Thank you very much for the tip. This REALLY worked!!!
|
|
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #709346 is a reply to message #647424] |
Wed, 03 August 2011 20:46   |
Eclipse User |
|
|
|
No real name wrote on Thu, 06 January 2011 04:06I encountered similar problem.The following method worked for me:
1 Goto Project->Properties->Run/Debug Settings, choose the .exe file and press "Edit"
2 In the "Environment" tag, press "New", set it as:
"Name:PATH"
"Value:C:\MinGW\bin"
BINGO!
|
|
|
Re: No Console Output (MinGW, CDT) [message #715434 is a reply to message #709346] |
Sun, 14 August 2011 01:39   |
Eclipse User |
|
|
|
well my platform (Win7 x64) exhibited the same behavior. The "path" approach did NOT resolve it, but adding -static to the MinGW linker flags (MinGW C++ Linker > Miscellaneous) DID resolve.
The strange thing (to me)... debugger almost always DID display output, but only "Release" exhibited the behavior. Still don't understand why static resolves it though.
SenseiC bows out.
|
|
|
Re: No Console Output (MinGW, CDT) [message #723368 is a reply to message #715434] |
Thu, 08 September 2011 12:27   |
Eclipse User |
|
|
|
One more thing to increase confusion: In a first step the PATH solution DID work for me and I successfully produced output for the "Hello World" program. But, then I only linked a static library (libtiff) and called some simple function from it and the output did not work anymore. (Although I can produce output using the Windows console.) Commenting out the simple library function brought back output. Strange, isn't it?
|
|
|
Re: No Console Output (MinGW, CDT) [message #724073 is a reply to message #723368] |
Sat, 10 September 2011 16:47   |
Eclipse User |
|
|
|
Hi Guys,
I fixed the problem on my win 7 x64 PC. In the Eclipse window go to Preferences > C/C++ (Expand it) > Environment > Add:
"Name:PATH"
"Value:C:\MinGW\bin"
If this does not fix it. Try adding the above to the system environment variables on your pc in Computer > Advanced System settings
Good Luck!!
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #809350 is a reply to message #724073] |
Tue, 28 February 2012 19:34   |
Eclipse User |
|
|
|
sydraps wrote on Sat, 10 September 2011 18:47Hi Guys,
I fixed the problem on my win 7 x64 PC. In the Eclipse window go to Preferences > C/C++ (Expand it) > Environment > Add:
"Name:PATH"
"Value:C:\MinGW\bin"
Hi,
thanks a lot for that, it resolved this problem for me.
But one thing:
On Eclipse 3.7.2 and CDT 8.0.2 the preferences for environment variables can be found in Eclipse at:
Window ->Preferences->C/C++->Build->Environment
Running Eclipse 3.7 64Bit + JDK 1.7.3 64Bit on Win7 64Bit.
Thanks again!
Best regards...
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #1058151 is a reply to message #1006589] |
Sun, 12 May 2013 15:49   |
Eclipse User |
|
|
|
Hi all,
To add some more peculiarities to the behavior described in this topic I'd like to share my experiences.
I'm running Windows 7 and Eclipse Juno 64 bit with MinGW.
I use the standard C++ hello world example to test the debugger and running the application.
From the start I have had output in the console in both debug and run mode. However, the console would not take any input.
After trying the many solutions listed here and elsewhere I had one success.
Adding the MinGW path to the environment variables of the run configuration enables the console to take user input.
Repeating this step for the debugger did not solve it there.
Adding the flush commands did not solve the problem.
Adding static options to the MinGW linker under Project Properties->C/C++ Build->Settings->MinWG C++ Linker->Miscellaneous did not solve the problem.
MinGW is set as the debugger at all the relevant places. In the main Debug Configuration tab all settings refer to the Debug build.
When I terminate the debugger the console buffer does seem to be flushed, as any characters I typed are sent to the program. Additionally, the termination command of the debugger also appears to generate some output that is sent to the program.
Output looks like this:
HelloWorld!
HelloWorld!
HelloWorld!
HelloWorld!
HelloWorld!
To exit, press 'm'
aaaaa
You just entered a. You need to enter m to exit.
You just entered a. You need to enter m to exit.
You just entered a. You need to enter m to exit.
You just entered a. You need to enter m to exit.
You just entered a. You need to enter m to exit.
You just entered 2. You need to enter m to exit.
You just entered 0. You need to enter m to exit.
You just entered -. You need to enter m to exit.
You just entered g. You need to enter m to exit.
You just entered d. You need to enter m to exit.
You just entered b. You need to enter m to exit.
You just entered -. You need to enter m to exit.
You just entered e. You need to enter m to exit.
You just entered x. You need to enter m to exit.
You just entered i. You need to enter m to exit.
You just entered t. You need to enter m to exit.
Any ideas to fix this behavior of the debugger are more than welcome. To stress, in Run mode the console works fine.
Many thanks,
Stefan
|
|
|
Re: No Console Output (MinGW, CDT) [message #1074405 is a reply to message #1058151] |
Fri, 26 July 2013 17:29   |
Eclipse User |
|
|
|
I had the problem after first install of eclipse C++ and MinGW. I don't know how i solved, but i write what i did.
The first install of eclipse for C++ 64bit was in c:\eclipseCpp, and the workspace (set as default + option "don't ask again") was in c:\eclipseCpp\workspace (notice that it's in the same folder)
After read this forum, i started downloading eclipse C++ 32 bit, and instead of deleting the previous installed eclipse, I renamed its folder:
c:\eclipseCpp --> c:\eclipseCpp64
Since still the eclipse32 was not downloaded, while waiting I started eclipse64 from the new location, and it couldn't find the workspace (of course, because i renamed the folder that contained also the default workspace!) so i switched to the new workspace path: c:\eclipseCpp64\workspace
Eclipse restarted, clicked on the .exe file "run as..." and... the console is working . So i didn't need to install eclipse32.
I don't know if i can give more details. The project was an hello world, and in the properties i set is at UTF-8 because with my print i wanted to test also accented letters.
CONCLUSION: try to rename the folder where you have eclipse, if that doesn't work, try also to rename the folder with your workspace without telling that to eclipse, then restart eclipse and switch workspace. Or maybe it's enough to just switch workspace?
[Hope my english is clear, to write so long text in foreign language was really tiring so i hope you understand]
Buona fortuna!
[Updated on: Fri, 26 July 2013 17:34] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: No Console Output (MinGW, CDT) [message #1751439 is a reply to message #629872] |
Tue, 10 January 2017 11:38   |
Eclipse User |
|
|
|
Your output is being buffered. You have 4 options:
1.explicit flush
fflush after each write to profit from the buffer and still enforce the desiredbehavior/display explicitly.
fflush( stdout );
2.have the buffer only buffer lines-wise
useful for when you know that it is enough to print only complete lines
setlinebuf(stdout);
3.disable the buffer
setbuf(stdout, NULL);
4.disable buffering in your console through what ever options menu it provides
|
|
|
|
|
|
|
|
|
|