|
|
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 #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 #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 #1074405 is a reply to message #1058151] |
Fri, 26 July 2013 17:29   |
Missing name Mising name Messages: 4 Registered: November 2009 |
Junior Member |
|
|
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] 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
|
|
|
|
|
|
|
|
|
|