3

I've created c++ "Hello World" sample project in eclipse using "cygwin GCC" Toolchain.

Project Compiles and run.The problem is that I don't see my "Hello World" Output in console below.

The Interesting fact is when I run my project in "Debug" mode , I do see an output after I execute :

    cout << "!!!Hello World!!!" << endl; 

How can I see my console output in simple "Run mode" ? I'm Using Eclipse Juno...

1
  • Are you using 64-bit Eclipse by any chance? Commented Apr 17, 2013 at 10:48

2 Answers 2

4

Thanks @einpoklum , following your links I've found a solution !

Make sure to run Eclipse as Administrator ! That's it :)

Of course if it still doesn't work , refer to @einpoklum answer.

Sign up to request clarification or add additional context in comments.

4 Comments

Actually, that should not be necessary. After all, many users can't use administrator privileges. Can you tell what you need them for, exactly?
Well... I don't fully understand why I need Administrator privileges. But it does solves the problem. Found it here : stackoverflow.com/a/9779984/930171
It just shifts the problem, it doesn't solve it, because you don't really need admin privileges. You need to prevent Eclipse or GCC or what-not from trying something which requires admin privileges.
Ugh finally. Thank you for this answer. It would be great to not need it but I don't care to figure out the source issue like others suggest I just want it to work.
2

This is a widely-reported problem with multiple possible solutions.

  • It might be your PATH environment variable. Make sure it contains C:\Cygwin\bin or wherever you installed Cygwin to. If that's missing, you might not be able to load the cygwin1.dll and Eclipse doesn't report that well enough.
  • Maybe it's due to output buffering. Try adding

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

    at the start of your main function.

  • Some people suggest trying a 32-bit version of Eclipse (and JRE). I would try to avoid going down that road...

1 Comment

I've added C:\Cygwin\bin to my PATH environment variable,nothing have changed.Those buffer commands didn't help either.Just to make things clear , I create a new C++ project from template (Hello World) using cygwin toolchain.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.