Nothing to Build

Hiiiiiiii guys.
Right, so, I have absolutely no idea what I'm doing, this is quite literally my first ever C++ program and it frightens me tbh. I'm doing the 'HelloWorld' program, cause, you know, no one ever does that.
Anyway, this is what I've got so far.
1
2
3
4
5
6
7
#include <iostream>
using namespace std;

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


I can decipher what most of it means, but my big problem is that when I go to launch it (I'm using the Eclipse IDE with the C++ plugins), it says:
1
2
3
4
**** Build of configuration Debug for project HelloWorld ****

**** Internal Builder is used for build               ****
Nothing to build for HelloWorld

After that the console goes blank.
Now, if I'm not mistaken, cout is pretty much a print out statement for a stream...right?
So in theory this should work.
I've taken a look at a number of tutorials and this seems the same across a number of examples, so either C++ hates me or I'm doing it wrong.
Thoughts?
Last edited on
You have to actually build the project before you can run it ... I think its ctrl+b in Eclipse. Try that, then run (ctrl+F11)

or maybe I'm misinterpretting the question.
I did,
the first time it said
1
2
3
4
5
6
7
**** Build of configuration Debug for project HelloWorld ****

**** Internal Builder is used for build               ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o src\HelloWorld.o ..\src\HelloWorld.cpp
g++ -o HelloWorld.exe src\HelloWorld.o
Build complete for project HelloWorld
Time consumed: 9610  ms.

(My computer was being mega slow for some herp tard reason) then after that it just goes back to the result posted above.
I had precisely the same problem that you described.

Did you ever figure out a solution to this problem?

Has anyone had any luck compiling a C++ program for Windows XP under Eclipse? I am using the MinGW toolchain.

Can anyone recommend some other SDK besides Eclipse? (I am ready to give up.)

Code::blocks Works nicely!
what OS do you use?
what OS do you use? It looks like its your compiler thats the issue
I recently (about 3 weeks ago) started learning c++ and had the same problems in building. Well now it is acctually going quite fine and i have upgraded my skills quite a bit. You should try using Bloodshed Dev C++ 4.9.9.2. When it came to compiling and debuging everything works, except that it shuts down when it does it's job, so your hello world program would just flash and disapear in a seconds. The sollution was.

1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>

using namespace std;

int main()
{
    int i;
    cout << "Hello world n stuff" ; // no point of endl here.
    cin >> i; // programm won't shut down until you press i
    return 0;
    
}
try using Bloodshed Dev C++

Please don't.
http://www.cplusplus.com/articles/36vU7k9E/
Last edited on
I did, the first time it said

1
2
3
4
5
6
7
**** Build of configuration Debug for project HelloWorld ****

**** Internal Builder is used for build               ****
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o src\HelloWorld.o ..\src\HelloWorld.cpp
g++ -o HelloWorld.exe src\HelloWorld.o
Build complete for project HelloWorld
Time consumed: 9610  ms.


So, the first time you used it, the project was successfully built. Subsequent attempts to build the project told you it was already built.

Maybe you should run the resulting executable?
Last edited on
Thanks for the replies.

I tried running the executable directly (not from Eclipse) and got the message:
- The application has failed to start because libgcc_s_dw2-1.dll was not found.

That file exists on C:\MinGW\bin

Do I merely have a problem with my path? (Forgive. I am new to programming on a PC.)

I also tried the " cin >> i; " trick mentioned by Emerican. I no longer get the "nothing to build" message, but instead it just says:

- <terminated>HelloWorld Debug[C/C++ Application> C:\...\Debug\HelloWorld.exe (3/28/12 ...)

but it never prints the Hello World message.

Thanks for any help.
Topic archived. No new replies allowed.