Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Help with first C++ Program
Help with first C++ Program [message #998137] Wed, 09 January 2013 07:32 Go to next message
Eclipse UserFriend
Hello!

I installed Eclipse C/C++ IDE Juno and MinGW Compiler tools. I created a Hello World C Program and it worked. Then I created a C++ Program for Hello World. It builds without errors but when the program is run inside eclipse it doesn't output anything. Below is the C++ code. Help me with the issue.

#include <iostream>
using namespace std;

int main(void) {

	cout << "Hello! C++" << endl;
	return 0;
} 


Edit: I tried to run the compiled file from Command Prompt but I get the error message libgcc_s_dw2-1.dll missing but I can see the file present in the MinGW/bin folder.

I also tried reinstalling eclipse c/C++ ide and MinGW but it is of no use. Can somebody solve the problem?

[Updated on: Wed, 09 January 2013 09:08] by Moderator

Re: Help with first C++ Program [message #1000385 is a reply to message #998137] Mon, 14 January 2013 11:21 Go to previous messageGo to next message
Eclipse UserFriend
project properties -> C/C++ Build -> Settings -> MinGW C++ Linker -> Misc
add libgcc_s_dw2-1.dll to "linker flags"
Re: Help with first C++ Program [message #1000709 is a reply to message #1000385] Tue, 15 January 2013 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi! Cong Chen. Thanks for replying. I did as you said (see the attached image) but still the .exe file in the release folder of the project doesnt output any messages. If I debug the .exe in the debug folder of the project it produces the desired output.
Re: Help with first C++ Program [message #1000771 is a reply to message #1000709] Tue, 15 January 2013 07:12 Go to previous messageGo to next message
Eclipse UserFriend
Jayanth D wrote on Tue, 15 January 2013 10:56
Hi! Cong Chen. Thanks for replying. I did as you said (see the attached image) but still the .exe file in the release folder of the project doesnt output any messages. If I debug the .exe in the debug folder of the project it produces the desired output.

Your program needs libgcc_s_dw2-1.dll to run.
You have 3 choices
- copy libgcc_s_dw2-1.dll to the folder with your executable
- copy libgcc_s_dw2-1.dll to a folder that is in your PATH env variable (or add the folder it rersides in to PATH)
- build your program with static gcc lib (you can google for the solution)
Re: Help with first C++ Program [message #1000994 is a reply to message #1000771] Tue, 15 January 2013 15:45 Go to previous messageGo to next message
Eclipse UserFriend
I tried the first option but it did not work. I copied the dll to the Release folder of the project.

I copied libgcc_s_dw2-1.dll to Projects Release folder and then ran the .exe from DOS prompt. It asked for another file libstdc++-6.dll. I put that also in the Release folder and ran the .exe from the dos prompt and I got the output but it doesn't work in the eclipse C/C++ IDE's console.

[Updated on: Tue, 15 January 2013 15:50] by Moderator

Re: Help with first C++ Program [message #1115750 is a reply to message #1000994] Tue, 24 September 2013 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Same Problem - same line of enquiry Confused
Re: Help with first C++ Program [message #1115778 is a reply to message #1115750] Tue, 24 September 2013 11:17 Go to previous message
Eclipse UserFriend
Same Problem - same line of enquiry Confused
+1
Previous Topic:Split Views in Eclipse 4.2 (Juno)
Next Topic:Setting correct build path
Goto Forum:
  


Current Time: Tue May 20 00:44:04 EDT 2025

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

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

Back to the top