I have a Windows 7 64-bit PC and I am trying to install a free C++ IDE, so I chose to install Eclipse Helios with CDT.
For g++, make and gdb I installed msys and mingw according to this tutorial: http://wiki.wxwidgets.org/HowTo:_Install_MSYS_and_MinGW_for_use_with_Eclipse_CDT
The versions are:
So it should be compatible with my 64-bit CPU.
However when I try to run a very simple program with eclipse, I see nothing on the console. The source code is:
#include <iostream> using namespace std; int main() { int i; cout << "Enter an integer: " << endl; cin >> i; cout << endl << "i is " << i << endl; return 0; }
The build is fine and when I launch the .exe with command (windows console) the behavior is as expected. But with the Eclipse console I see nothing with run and with debug the output is just: "Enter an integer: ", then when I type in a number and hit enter it does nothing.
Does anyone know how to fix this please?
Thanks,
Guillaume
PS: I use the toolchain "Linux GCC", with "MinGW GCC" I have nothing at all in the console.
Inside Eclipse -> Click on "Window" Select "Show View" Then select "Console" If you cannot see console in the list, select "Other" and then search for "console' in new dialog at top and select "Console"
Installed MinGW is not available on eclipse. New path, ;C:\MinGW\mingw32\bin (C:\MinGW is chosen during MinGW installation) has been added to environment variable path. Eclipse launched properly. However, MinGW is not available on eclipse.
Unfortunately Eclipse only provides the Integrated Development Environment (IDE) but it is missing the actual compiler. To install a compiler, please follow the instructions for your operating system.
A CDT project typically has two builders. The first one is the CDT builder which is responsible for compiling your code. If you are using an external build tool you are most likely using a "makefile project", in which case the CDT builder simply invokes your build tool for you.
This worked for me on 64-bit install of Eclipse on Windows 7 using MinGW:
Right-click on your project. Select "Properties".
Select the "Run/Debug Settings" Property on the left of the new window.
In the right window, click on your executable to highlight (ie - Test.exe) and click "Edit".
In the Environment tab, hit "New"
Name: PATH
Value: Path to your MinGW bin directory. (For me this was: C:\devcore\MinGW\bin
)
Click "OK" on all windows to close down.
Try running again, it should print output to the screen.
You need to set up linker I am using MinGW.
Follow below steps.
Goto Project > Properties > C/C++ Build > Settings > Tool Settings (Tab) > MinGW C++ Linker (Option) > Add Command (g++ -static-libgcc -static-libstdc++) (default command is only g++)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With