By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,677 Members | 1,060 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,677 IT Pros & Developers. It's quick & easy.

How to fix compiler error: "Namespace name expected" ?

P: 1
Hi, I installed a Borland C++ in my laptop a 32-bit operating system with windows vista.

I wrote i very simple program to display "Hello world" but it gives an error

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}

the error is [noname00.ccp(3, 16): Namespace name expected, please help me

Mathew
Dec 2 '10 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,916
You code looks completely fine to me and compiles without problem using MinGW on Windows XP.

I have to say my suspicions as soon as you mentioned "Borland C++" since they are not really a compiler writer any more so I am kind of assuming that you are using an out of date compiler.

I would suggest that you try I different more up to date compiler such as MinGW or Microsoft Visual C++ Express Edition (both of which are free).
Dec 2 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.