![]() |
Beginning C++, got stuck immediately!
I'm doing a C++ video tutorial. They tutors are using Visual Studio 2003, I'm using Visual Studio 2005. Compiling the code just below worked fine for them:
Code:
#include <iostream>Code:
end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?I don't know what any of this stuff means yet but my C++ project is a Win32 Console Application. |
Re: Beginning C++, got stuck immediately!
main [] should be main()
Offtopic comment: Upi had the quote block where as it should be code block. |
Re: Beginning C++, got stuck immediately!
Not only should main [] be main (), main should be declared to return an int. C++ does not support main as a void type, nor does it support an implicit type of int. If your compiler does, it is non-compliant in that respect.
Code:
int main ()All that is not the seat of your current problem, however. You need to go to Project/Properties/Configuration Properties/C C++/Precompiled Headers and select "Not using precompiled headers". Then delete all references to stdafx as well as stdafx.h. |
Re: Beginning C++, got stuck immediately!
Wow very good help indeed, better then I was hoping for. Before I continue the lessons can you tell me why it worked for them and not me? It's startng to feel like I'm end up getting alot of that from the tutorials and maybe should find something else to learn from. ($100 well spend it seems.)
Code:
#include <iostream>Code:
1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------ |
Re: Beginning C++, got stuck immediately!
Apologies, I forgot the code block again.
|
Re: Beginning C++, got stuck immediately!
Build is not the same thing as run. Build rebuilds the program from scratch. This means:
1. Each source file (you may have more than one) is a. preprocessed b. compiled 2. All resulting object files are linked into an executable. T-T-t-t-t-hat's a-a-a-a-l-l-l-l f-f-f-f-olks. If you want to run it, do so. You need to do two things: continue your studies; learn your tools. I doubt seriously that you would buy plans for a gazebo and buy a couple K worth of power tools and start in without reading both the plans AND the manuals for the tools. If you would, don't call me to donate extra fingers for you. Don't do it in programming, either. Your tool (the compiler/IDE) has help files. Use them. |
Re: Beginning C++, got stuck immediately!
by the way, the configuration manager says Configuration is in Debug mode, is that right? I switched it over to Release to see what that would change and then I started getting that same error from the first post again so I brought it back to Debug.
|
Re: Beginning C++, got stuck immediately!
Like I said, read your help files. They explain debug versus release mode.
Let me say something else: perhaps this is a game to you, like playing Mario II, or something. If it is, have fun. In the real world it is not a game. It produces things which advance the progress of mankind. Perhaps one percent of professionals, even, get this. This stuff is used to build intravenous infusions pumps. If you **** around, someone dies. Astronauts don't get home. Less importantly, mail doesn't get delivered. I hope you get the picture. |
Re: Beginning C++, got stuck immediately!
Quote:
|
Re: Beginning C++, got stuck immediately!
Quote:
|
| All times are GMT +5.5. The time now is 05:44. |