Hi, I just began taking a C++ class at my highschool. We're using MetroWorks CodeWarrior IDE. Anyway, I tried writing a hello world program at home and compiling it with Microsoft Visual C++ 2010 Express, but a dialogue box popped up. It read as follows:
This project is out of date:
Hello_World_2 - Debug Win32
Would you like to build it?
I clicked yes and another dialogue box popped up, saying there were build errors.
I don't program in that environment... although I really want to :D.
I think it's something to do with your int main()... in windows they make you write a it a different way or it won't compile...
I think it's like int winmain() or some bs like that. I disagree with changing such a fundamental thing like that... but i don't really know much about why it was changed.
Well now I started a new empty project called "Hello_World3" and entered the same code. It still said it was out of date, and when I tried to build it it said it couldn't find the specified file. I tried the same code in a CLR Console Application and it said there were build errors again. And each attempt also said it was out of date.
@NetHacker - On visual studio 2010 what you want to do is create a new empty project - you will then see nothing on your screen. Hopefully if you look to the right or left you should see a folder like thing called Source Files (IF you do not see Source Files folder You might not have the solutions explorer enabled-> To do that go to View -> Solutions Explorer)
Right click on the source files and say add -> New Item -> click on the .cpp file and call it main. then start Coding!
If you have major problems and nothing is working - a quick work around is to install Code::Blocks, Its pretty noob friendly and on code blocks you just say you want a console application and it even writes a hello world app for you
EDIT: Also your program will just briefly flash once you compile it -> Add a cin.ignore(); just before the return 0; to pause it
Alternatively just press Ctrl+F5 in Visual Studio and the window will stay open. Personally I would recommend using Vim for and a command line for compiling/linking. I find programming in Vim a much nicer enviroment than Visual Studio, and using gcc is great for compiling C and C++ programs once you get the hang of makefiles and the likes. I assume you're running windows since you're using Visual Studio so I would recommend downloading cygwin and using gcc with it, since I doubt you want to switch to a Linux OS that comes with gcc on it.