| Help with first C++ Program [message #998137] |
Wed, 09 January 2013 07:32  |
Jayanth D Messages: 16 Registered: December 2012 |
Junior Member |
|
|
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] Report message to a moderator
|
|
|
|
|
| Re: Help with first C++ Program [message #1000771 is a reply to message #1000709] |
Tue, 15 January 2013 07:12   |
Axel Mueller Messages: 1882 Registered: July 2009 |
Senior Member |
|
|
Jayanth D wrote on Tue, 15 January 2013 10:56Hi! 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)
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
| Re: Help with first C++ Program [message #1000994 is a reply to message #1000771] |
Tue, 15 January 2013 15:45   |
Jayanth D Messages: 16 Registered: December 2012 |
Junior Member |
|
|
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] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01656 seconds