// A C++ program begins at main ()
int main ()
{
cout << "C++ is power programming.";
return 0;
}
In my compiler so i put it in microsoft visual c++ 2008 express but it never told me what kind of project it was supposed to be and just told me to copy it in. I made my project a win32 console application and typed it in exactly but it couldn't compile it. So i read ahead of the book and it said to first name it sample.cpp which i already did and it said to first type it in wordpad so i did that to. after i did that it showed me a lot of command lines.
Could you people help me? i just started so sorry for being such a nooby.
Oh and i have to go so sorry i can't stay on this page for to long right now so if i dont reply to your answers or suggestions on my mistakes please forgive me. thanks!
It should be a win32 app if your beginner (Thats what iam starting with)
I'll post pic
Originally Posted by Void
Mind posting the errors you were getting?
fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add 'c "stdafx.h"' to your source?
The book didn't mention anything about the #include stdafx.h so i dont think im supposed to put that in
I read on to what to do if i needed help and it said to use the command line C:\...>cl -GX Sample.cpp
Any idea what that is?
Then what do you mean it's not compiling? If it didn't compile there must be some error...
Originally Posted by Void
Then what do you mean it's not compiling? If it didn't compile there must be some error...
It just said it failed and in the book it said to add C:\...>cl -GX but i dont know what that is
The book is telling you to compile from Visual Studio's command line. CL.exe is the compiler it uses. -GX is like a parameter for CL. I recommend using a simpler IDE, such as Dev-C++..
Originally Posted by Void
The book is telling you to compile from Visual Studio's command line. CL.exe is the compiler it uses. -GX is like a parameter for CL. I recommend using a simpler IDE, such as Dev-C++..
ok ill try that out right now
Create a empty project
Right-Click on Source Files
Add New Item
Name it Sample.cpp
Add code
Profit
i honestly don't see what could go wrong
New project > Empty Project > Right click on the Folder "source" and create New .cpp file.
Well I guess creating an empty project works too. =o=
well, thaats how i learned it, and because i dont like creating projects with main.cpp already created with some random code
Originally Posted by TailsTehFox
New project > Empty Project > Right click on the Folder "source" and create New .cpp file.
Where is the folder source?
I think you should just use Dev-C++ until you've gained some experience using a basic IDE. Or you can be a man and use the command line to compile.