View Single Post
  #1 (permalink)  
Old June 17th, 2008, 02:23 AM
Jiffyman Jiffyman is offline
Registered User
 
Join Date: Jun 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Errors Compiling

I am having errors compiling a simple Hello World with g++ in linux.

The program source is written like this

1: #include <iostream.h>
2:
3: int main()
4: {
5: cout << "Hello World!\n";
6: return 0;
7: }

When I compile I get this error:

geoff@Geoffs-Ubuntu-X64:g++ Hello-World.cpp
Hello-World.cpp:1: error: stray ‘#’ in program
Hello-World.cpp:1: error: expected unqualified-id before numeric constant


I wrote the program exactly as told.




Reply With Quote