Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » HelloWorld not running
HelloWorld not running [message #1616883] Sat, 14 February 2015 22:54 Go to next message
Kela Jaro is currently offline Kela JaroFriend
Messages: 1
Registered: February 2015
Junior Member
I followed the tutorial to create a simple application, HelloWorld. Super simple until I try to Run it. A pop-up window says "HelloWorld.exe has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available."

I've recreated the project several times, and the same pop up comes up every time I try to Run it.

Is this unrelated to how I created the project? Do I need to reinstall eclipse or Mingw?
Re: HelloWorld not running [message #1619556 is a reply to message #1616883] Mon, 16 February 2015 17:12 Go to previous messageGo to next message
Armond Conte is currently offline Armond ConteFriend
Messages: 1
Registered: February 2015
Junior Member
Hey Kela, I have been having the same problem, but when I debug I don't have any issue, don't know if that will help your problem until you get something that needs to be run.
FYI - I'm also really new to using Eclipse for anything in general so this could still be an easy fix.

I am using Windows 8 with 32-Bit Eclipse and MinGW (as well as associated C++ Libraries) with Eclipse Luna.
I created a new "Hello World" project using:
File > New > C++ Project >
- Select: Hello World C++ Project and MinGW GCC
-No bugs upon building
I then go to Run > Debug, step line-by-line and everything goes fine with the "!!!Hello World!!!" appearing in the console area.
I then try to hit the run button and get a stopped working notification from Windows stating that something stopped the program from running.

Anybody else have suggestions on why this might happen?
Re: HelloWorld not running [message #1631835 is a reply to message #1619556] Tue, 24 February 2015 01:17 Go to previous messageGo to next message
Morgan Nguyen is currently offline Morgan NguyenFriend
Messages: 2
Registered: February 2015
Junior Member
I'm super new to coding in general and I was hoping to get right to setting up eclipse but this exact same thing is happening to me too! What's going on? Hitting run stops the hello world.exe from working. Going into debug doesn't quite work 100% either. The only way I can get the program to work is to go into debug, then press that "disconnect" button and it shows up hello world in the counsel! I've downloaded everything including all the basic downloads from MinGW and I've also downloaded Java for it too.
Re: HelloWorld not running [message #1631921 is a reply to message #1619556] Tue, 24 February 2015 02:26 Go to previous messageGo to next message
Morgan Nguyen is currently offline Morgan NguyenFriend
Messages: 2
Registered: February 2015
Junior Member
omg I found the answer! for the love of...! ok check this out. I'm going to be very specific here. Whenever you make a new project, you have to have that project up. When you run it, you'll see that the error message of how it stopped working shows up and you're pretty screwed. Now, all you have to do is go to project>properties (here just make sure you read the heading of the window that pops up, it MUST say properties of "yourfilename" which leaves to me believe you have to do this to each and every project you start)>C/C++ build>settings>Tool settings>MinGW C++ Linker>Miscellaneous>Linker flags>type in the box to the right of linker flags "-static-libgcc -static-libstdc++">hit apply>ok>rerun the program YOU'RE WELCOME!
Re: HelloWorld not running [message #1659779 is a reply to message #1631921] Mon, 09 March 2015 00:23 Go to previous messageGo to next message
Brian Smith is currently offline Brian SmithFriend
Messages: 2
Registered: March 2015
Junior Member
I have already added "-static-libgcc -static-libstdc++". Still when I produce a project on Eclipse, I get multiple error messages. When I run Eclipse Luna, I receive the following message: "cc1.exe has stopped working". I also receive this message when I run a project, e.g., "Hello World". After spending many hours, still I can't figure out how to make Eclipse Luna work. I have already installed Java SE 8 and MinGW. My operating system is Windows Vista 64-bit. In the tool chain, I made MinGW the default compiler and in the Makefile project, I check marked PE Windows Parser. Can someone tell me what to do?
Re: HelloWorld not running [message #1684593 is a reply to message #1659779] Wed, 18 March 2015 13:47 Go to previous messageGo to next message
JP Benedict is currently offline JP BenedictFriend
Messages: 1
Registered: March 2015
Junior Member
Good to know I'm not the only one!
Re: HelloWorld not running [message #1686045 is a reply to message #1631921] Thu, 19 March 2015 03:29 Go to previous messageGo to next message
diana barros is currently offline diana barrosFriend
Messages: 2
Registered: March 2015
Junior Member
Morgan Nguyen wrote on Tue, 24 February 2015 02:26
omg I found the answer! for the love of...! ok check this out. I'm going to be very specific here. Whenever you make a new project, you have to have that project up. When you run it, you'll see that the error message of how it stopped working shows up and you're pretty screwed. Now, all you have to do is go to project>properties (here just make sure you read the heading of the window that pops up, it MUST say properties of "yourfilename" which leaves to me believe you have to do this to each and every project you start)>C/C++ build>settings>Tool settings>MinGW C++ Linker>Miscellaneous>Linker flags>type in the box to the right of linker flags "-static-libgcc -static-libstdc++">hit apply>ok>rerun the program YOU'RE WELCOME!


What exactly happens here?
I've been having the same problem and it was solved by doing this. But isn't there a way to set this up? Everytime I try to run a project will I have to do this?
Re: HelloWorld not running [message #1687721 is a reply to message #1616883] Thu, 19 March 2015 19:23 Go to previous messageGo to next message
diana barros is currently offline diana barrosFriend
Messages: 2
Registered: March 2015
Junior Member
Oh I just found out what was happening. There was a missing configuration part:

After installing the gcc compiler you were supposed to go to Control Panel > System > Advanced System Settings > Enviroment Variables

Look in System Variables and find the variable Path and click edit(even if you see the highlighted Path in the User variables, make sure you are editting the System Variables!). Copy C:\MinGW\bin;C:\MinGW\msys\1.0\bin; and paste after the last ; in the Variable Value.
Click Ok three times and you're good to go!
Re: HelloWorld not running [message #1692248 is a reply to message #1616883] Tue, 14 April 2015 14:01 Go to previous messageGo to next message
Joseph Gagnon is currently offline Joseph GagnonFriend
Messages: 68
Registered: June 2013
Member
I'm having the same problem, but with a different set of symptoms. I'm using eclipse Kepler on Windows 7 (64-bit), and MinGW (also 64-bit). I tried following the simple HelloWorld tutorial on the eclipse help page, but the problem I'm having is that for some reason it can't find the most basic things.

#include <iostream>
using namespace std;

int main() {
	cout << "Hello World!!!" << endl; // prints Hello World!!!
	return 0;
}


The Problems view:

Description Resource Path Location Type
Symbol 'std' could not be resolved Test.cpp /Test/src line 10 Semantic Error
Symbol 'cout' could not be resolved Test.cpp /Test/src line 13 Semantic Error
Symbol 'endl' could not be resolved Test.cpp /Test/src line 13 Semantic Error

There has to be some simple basic piece of configuration I'm missing. I just don't know what it is.

I'm pretty familiar with eclipse, but for Java development. This is the first time trying to do C/C++ development with it.

I assume I haven't set a variable somewhere (in eclipse or outside) or something similar. Can anyone help?

[Updated on: Tue, 14 April 2015 14:10]

Report message to a moderator

Re: HelloWorld not running [message #1692249 is a reply to message #1687721] Tue, 14 April 2015 14:04 Go to previous messageGo to next message
Joseph Gagnon is currently offline Joseph GagnonFriend
Messages: 68
Registered: June 2013
Member
I don't know how significant this might be, but I don't see a "msys" subdirectory under my c:\MinGW directory. Should there be one? If so, I wonder why I didn't get it when I installed MinGW?
Re: HelloWorld not running [message #1698629 is a reply to message #1616883] Tue, 16 June 2015 18:49 Go to previous message
Jeff Learman is currently offline Jeff LearmanFriend
Messages: 1
Registered: June 2015
Junior Member
I'm having the same problem, using cygwin dev tools, on 64 bit Win8.

I have cygwin/bin in my PATH; otherwise the test program wouldn't have built. Also, I can run the .exe file from a Win cmd shell, and it runs without errors. Something's not set up right in how eclipse runs the application normally versus how it runs it for debugging. The configuration under "Run configurations ..." looks reasonable (running Debug/test.exe, no special setup.)

Is there anyway to see logging? The build logs disappear from console when build is successful. Perhaps there is output to stderr before the popup window appears; if so, where would that appear? (The console is blank.)

[Edit: My bad. Evidently I hadn't restarted Eclipse after adjusting PATH, or something. Restarting Eclipse solved my issue. Sorry for the noise.]

[Updated on: Wed, 17 June 2015 15:41]

Report message to a moderator

Previous Topic:Remote debugging automatically starts server
Next Topic:Binary file filename.so.out not found - does your project have errors in it?
Goto Forum:
  


Current Time: Tue Apr 16 18:09:15 GMT 2024

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

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

Back to the top