UnhappyPlease Help me

Posts 1–15 of 23 · Page 1 of 2
Please Help me
Hey guys im having trouble with my first program i need help,

so im trying to make the "Hello World" program
but i get these errors when i build it


ImageShack® - Online Photo and Video Hosting


Can someone please help me, oh and btw im using windows 7 64-bit
Well according to what it says its one of two things:

-Either the program is not correctly installed

-You made a different type of project. It should be "Console Application"
Tryed everything can someone please help please it gfetting annoying
Quote Originally Posted by Zack View Post
Tryed everything can someone please help please it gfetting annoying
Ok man so create a new project and make it a console application. Choose empty project. Now put your code into the coding window, and then Compile & Run.
Quote Originally Posted by fukojr2 View Post


Ok man so create a new project and make it a console application. Choose empty project. Now put your code into the coding window, and then Compile & Run.
Is that hello world program actually right? Because I used this style:
Code:
#include "stdafx.h"
#include <iostream>

int main()
{
     using namespace std;
     cout << "Hello World!" << endl;
     return 0;
}
That compiled well and ran well too.
Quote Originally Posted by Unicow View Post
Is that hello world program actually right? Because I used this style:
Code:
#include "stdafx.h"
#include <iostream>

int main()
{
     using namespace std;
     cout << "Hello World!" << endl;
     return 0;
}
That compiled well and ran well too.
using namespace std is in your main?

and you dont need to daum include stdafx for a project that small, nobody uses it.

He's running it in Debug mode, run it without debugging.
Quote Originally Posted by Auxilium View Post


using namespace std is in your main?

and you dont need to daum include stdafx for a project that small, nobody uses it.

He's running it in Debug mode, run it without debugging.
Lol,,,He said that run well too !
Quote Originally Posted by Hassan View Post


Lol,,,He said that run well too !
I could have a couple useless abstract base classes and some wild pointers and it would run fine too. stdafx is unneeded and using namespaces are neater when put before main, after includes and crap
Quote Originally Posted by Auxilium View Post


I could have a couple useless abstract base classes and some wild pointers and it would run fine too. stdafx is unneeded and using namespaces are neater when put before main, after includes and crap
would using namespace even work with other functions if its inside main..?
Quote Originally Posted by mookamoka3 View Post
would using namespace even work with other functions if its inside main..?
Declare it before anything that uses it. Its best to just put it after your includes.
Quote Originally Posted by Auxilium View Post


Declare it before anything that uses it. Its best to just put it after your includes.
Yeeeep thats what i do.

@Unicow his style is basically the same as yours, except instead of using endl to create a new line he just used '\n'. It does the same thing in the end, but it's more common to just use endl.
Quote Originally Posted by mookamoka3 View Post
Yeeeep thats what i do.

@Unicow his style is basically the same as yours, except instead of using endl to create a new line he just used '\n'. It does the same thing in the end, but it's more common to just use endl.
I see, Thanks. Didn't know that, I just found mine on Learncpp.com :P.
thanks i dont get errors anymore but when i run a small black windows pops up for 1 sec and then goes away, oh and btw u did "Win32 Console application"
Quote Originally Posted by Zack View Post
thanks i dont get errors anymore but when i run a small black windows pops up for 1 sec and then goes away, oh and btw u did "Win32 Console application"
thats because console applications are ment to be run from cmd(start>run>cmd)

You can add a cin.get(); right before the last return in main(), then i'll stop there untill you press enter
Before: return 0;
Typ: char f;
cin >> f;
Posts 1–15 of 23 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us