Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Can't get eclipse for C++ to run program(created C++ project to say :Goodbye World; it won't run)
Can't get eclipse for C++ to run program [message #1304687] Sun, 20 April 2014 01:31 Go to next message
Felicity Beeson is currently offline Felicity BeesonFriend
Messages: 6
Registered: June 2012
Junior Member
Hi,
I am experienced with eclipse for Java development; have been using it since at least calypso.

I downloaded and installed MinGW: downloaded mingw-get-setup.exe and ran it; I selected everything it would let me select to install in two windows and Applied Changes; I now have a C:/MinGW folder; my PATH includes ...\;C:\MinGW\mingw32\bin\; -the last entry.

I downloaded eclipse-java-kepler-SR2-win32-x86_64.zip and extracted it. I ran it.

I created File>New>Project>C++ Project>Project Type>Executable>Empty Project and created a project called GoodbyeWorld. The Toolchains window showed Cross GCC, Microsoft Visual C++, and MinGW GCC; I select MinGW GCC. The Select Configurations page showed Project type: Executable, Toolchains: MinGW GCC and had both Debug and Release checked; I finished and the project was created.

I add a source .cpp file called GoodbyeWorld.cpp, Template: Default C++ source template; I put the following code in it:
/*
 * helloworld.cpp

 *
 *  Created on: Apr 19, 2014
 *      Author: Ms Phelix
 */
#include <iostream>
using namespace std;
int main()
{
	cout << "Goodbye World!";

	return 0;
}


I built the project: Project>Build Project; it built without any message I could interpret as an error or failure. Project Explorer now shows:
GoodbyeWorld
Binaries
Includes
Debug
GoodbyeWorld.cpp

I ran it: Run>Run; nothing happened; I was looking in the Console view for it to say Goodbye World! but it didn't; it immediately said <terminated>.

I put a breakpoint on the cout line and debugged it: Run>Debug; it stopped on the breakpoint and when I hit F8 to resume, it flashed something so fast I couldn't see what it said and I couldn't scroll up to see what it had said.

What was still visible was
either
Goodbye World!=thread-exited,id="1",group-id="i1"
or
The target endianness is set automatically (currently little endian)
[New Thread 5768.0x12b8]
Quit (expect signal SIGINT when the program is resumed)

Can you please help me get this working?
Thank you.

[Updated on: Sun, 20 April 2014 01:32]

Report message to a moderator

Re: Can't get eclipse for C++ to run program [message #1305063 is a reply to message #1304687] Sun, 20 April 2014 06:42 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
http://www.eclipse.org/forums/index.php/t/197552/
Re: Can't get eclipse for C++ to run program [message #1305064 is a reply to message #1304687] Sun, 20 April 2014 06:43 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
No Message Body

[Updated on: Mon, 21 April 2014 09:31]

Report message to a moderator

Re: Can't get eclipse for C++ to run program [message #1305938 is a reply to message #1305063] Sun, 20 April 2014 18:44 Go to previous messageGo to next message
Felicity Beeson is currently offline Felicity BeesonFriend
Messages: 6
Registered: June 2012
Junior Member
Thank you for replying so quickly.
After a little research on setvbuf(), I changed my code and built and ran it. Again I got no response when I ran it and got a different response when I debugged it.

I have attached an image of eclipse after debugging to let you see it. (I can't see anything to tell me it was successfully attached so let me know if it's not there.)

Any other ideas?

Thank you.

[Updated on: Sun, 20 April 2014 22:06]

Report message to a moderator

Re: Can't get eclipse for C++ to run program [message #1307377 is a reply to message #1305938] Mon, 21 April 2014 14:24 Go to previous messageGo to next message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
On 20-04-14 20:44, Felicity Beeson wrote:
> Thank you for replying so quickly.
> After a little research on setvbuf(), I changed my code and built and
> ran it. Again I got no response when I ran it and got I different
> response when I debugged it.
>
> I have attached an image of eclipse after debugging to let you see it.
>
> Any other ideas?

Does the program run in a Windows shell (i.e. cmd.exe)? If not, your
path is is not correct. It should contain "C:\MinGW\bin" and
"C:\MinGW\msys\1.0\bin" , depending on the path of your installation and
whether you have installed Msys.


Cheers,

Joost
Re: Can't get eclipse for C++ to run program [message #1308210 is a reply to message #1307377] Tue, 22 April 2014 01:27 Go to previous messageGo to next message
Felicity Beeson is currently offline Felicity BeesonFriend
Messages: 6
Registered: June 2012
Junior Member
Joost,

THANK YOU!!

My path was wrong in two ways:

I had "C:\MinGW\minGW32\bin" instead of "C:\MinGW\bin"; I don't know what I was thinking;

and

I didn't have "C:\MinGW\msys\1.0\bin".

Once I correct the path, my program ran perfectly. Smile

Again thank you.
Re: Can't get eclipse for C++ to run program [message #1783263 is a reply to message #1304687] Sat, 10 March 2018 04:57 Go to previous message
Bailey Johnston is currently offline Bailey JohnstonFriend
Messages: 15
Registered: February 2018
Junior Member
I can't get eclipse to let me edit code unless I have source like hello world. how did you get it to edit?
Previous Topic:CDT Language Server
Next Topic:Modes in Embedded Software development
Goto Forum:
  


Current Time: Fri Apr 19 13:41:22 GMT 2024

Powered by FUDForum. Page generated in 0.02936 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top