3

I just installed c/c++ development tools for my eclipse and everything is working except no text is being printed in the console when I run the hello world program, but I receive no errors. I'm really stumped, anyone know why this is?

enter image description here Edit:

Ok I realized if that debug it, it works correctly, but not if I run it, any ideas there?

Ryan Stull
  • 1,056
  • 14
  • 35
  • You program seems fine. How about your eclipse? You could try some sample code see if it works properly. – zw324 Jul 12 '11 at 04:53

4 Answers4

6

Are you using a 64-bit version of Eclipse? If so, that might be your problem. The 64-bit version doesn't do console output. sigh Try downgrading to the 32-bit version.

On SO, check this question. On the Eclipse forums, check this thread.

Community
  • 1
  • 1
Steve Blackwell
  • 5,904
  • 32
  • 49
2

Does a window pop up then disappear? It could be printing it in console then closing as soon as it hits the end of the code...

andrw
  • 790
  • 1
  • 8
  • 20
1

try to make your code like this:

#include <iostream>
#include <conio.h>

using namespase std;

int main()
{
  cout << "helllo, world" << endl;
  getch();
  return 0;
}
shengy
  • 9,461
  • 4
  • 37
  • 61
0

You must set the environment so the eclipse can find the c++ compiler.
Go to Computer and right click Properties -> advanced system settings -> enviroment variables.
Scroll down in system variables and find the path (it is named so). Press edit and append in the path the value C:\MinGW\bin;C:\MinGW\msys\1.0\bin;. You will have something like C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\programfiles........
Then start again the eclipse the problem should have been solved.

RITZ XAVI
  • 3,633
  • 1
  • 25
  • 35
peri
  • 1