Help with compiling?

Posts 1–15 of 16 · Page 1 of 2
Help with compiling?
I just started teaching my self c++ yesterday and i using Visual C++ Express Edition. When ever i try to compile the simpilest line of code i get the error

Code:
1>------ Build started: Project: firsttutorial, Configuration: Debug Win32 ------
1>Compiling...
1>firsttutorial.cpp
1>c:\users\anthony\documents\visual studio 2008\projects\firsttutorial\firsttutorial\firsttutorial.cpp(10) : error C2065: 'cout' : undeclared identifier
1>Build log was saved at "file://c:\Users\Anthony\Documents\Visual Studio 2008\Projects\firsttutorial\firsttutorial\Debug\BuildLog.htm"
1>firsttutorial - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What am i doing wrong and is there a better compiler for me to be using?
Did you include the line :
Code:
using namespace std
but thats normal c++...your using VISUAL C++ so i might be wrong

Next time you have a problem with a compiling error, post the code.
Quote Originally Posted by zhaoyun333 View Post
Did you include the line :
Code:
using namespace std
but thats normal c++...your using VISUAL C++ so i might be wrong

Next time you have a problem with a compiling error, post the code.
Ok, can you just give me the name of a compiler that is code for beginners?
1>c:\users\anthony\documents\visual studio 2008\projects\firsttutorial\firsttutorial\firsttut orial.cpp(7) : error C2447: '{' : missing function header (old-style formal list?


What does that error mean?
Just paste your actual C++ here so I Can fix it for you =/
Quote Originally Posted by Toymaker View Post
Just paste your actual C++ here so I Can fix it for you =/
I just trid to compile the first hello world Tutorial in the book i downloaded, here it is:
Code:
// firsttutorial.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

int main();
{
 cout; <<"Hello World!n";
 return 0;}
Code:
#include <iostream>
using namespace std;
int main() {
 cout; <<"Hello World n";
 system("pause");
}
Try a standard tutorial man, a working version looks more like this You also had multiple errors like putting ; after main() and without using namespace std you can't use cout without std:: in front of it and \n is the proper next line code and that tutorial must have it's own header file but all compilers have iostream and I added system'pause' so you can actually see the message before it closes. Good luck.
wrong button double posted
For normal C++ the proper code is:
Code:
#include <iostream>

using namespace std;

int main(){

cout<<"Hello World!"<<endl;

system("pause");

return;}
Can anyone give me a better compiler for me a beginner then? The one hat came with the tutorial isnt wrking for me neither are alot of them
Just google Bloodshev Dev-C++ compiler or something and use my example instead of zhao's, good luck. The tutorial you followed was the only problem. The code wasn't done correctly.
Quote Originally Posted by Toymaker View Post
Just google Bloodshev Dev-C++ compiler or something and use my example instead of zhao's, good luck. The tutorial you followed was the only problem. The code wasn't done correctly.
I cant find bloodshevs but i can find bloodshed, can you give me a better tutorial please? THe lear c++ in 21 days wasnt working out good for me
I think i found it but whenever i run it i get the error:
There doesn seem to be a GNU make file in the PATH.....
How do fix this?
Learn C++ not VC++. I use and recommend Borland C++/C compiler.
zhaoyun change ur sig ur not good at c++ else you wouldnt be amazed by the code in ur sig
Posts 1–15 of 16 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

Talk with us