Complete newbie needs gcc compiler help
From: James Bond (jbond_at_ue.com)
Date: 06/14/04
- Next message: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Previous message: Michael \(michka\) Kaplan [MS]: "Re: Open source alternative for MsAccess?"
- Next in thread: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Reply: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Reply: yoonsoo: "Re: Complete newbie needs gcc compiler help"
- Reply: QNils_O=2E_Sel=E5sdal=22?=: "Re: Complete newbie needs gcc compiler help"
- Reply: Christina: "Re: Complete newbie needs gcc compiler help"
- Reply: Christina: "Re: Complete newbie needs gcc compiler help"
- Reply: Sayantam Dey: "Re: Complete newbie needs gcc compiler help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 14 Jun 2004 09:17:37 -0400
I am a newbie to linux programming, and am trying to learn a little c++.
And much to my chagrin, I am having problems at the very beginning: I
can't get the compiler to work properly.
After perusing hundreds of useful online resources for c++ and linux
programming, I have discovered that nearly everything assumes you can
already use the compiler effectively. Reading the man page for gcc makes
it look easy, but I am stumbling somewhere.
Trying to write a simple hello world program,using a regular text editor,
I type this (comes from a Sam's book on c++ programming):
#include <iostream>
void Main()
{
cout << "Hello World.\n";
}
I save this to hello.cpp and then from the command line I type "g++ -o
hello hello.cpp"
I get the message the cout is undefined. It looks just like this:
[jb@localhost Source]$ g++ -o hello hello.cpp
hello.cpp: In function `void Main()':
hello.cpp:9: error: `cout' undeclared (first use this function)
hello.cpp:9: error: (Each undeclared identifier is reported only once
for each function it appears in.)
[jb@localhost Source]$
g++ -v tells me that I am using:
gcc version 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
To me, that error implies that either cout is not defined in the iostream
library, yet my book, and several other sources, are quite clear that it
is. Otherwise, I assume I am doing something wrong with the compiler.
Finally, I guess that I might not have the proper libraries installed, but
if that is the case, I have been unable to determine just what I need.
Any help getting over this early hurdle is greatly appreciated. Thank you.
James
- Next message: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Previous message: Michael \(michka\) Kaplan [MS]: "Re: Open source alternative for MsAccess?"
- Next in thread: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Reply: Kenji Chan: "Re: Complete newbie needs gcc compiler help"
- Reply: yoonsoo: "Re: Complete newbie needs gcc compiler help"
- Reply: QNils_O=2E_Sel=E5sdal=22?=: "Re: Complete newbie needs gcc compiler help"
- Reply: Christina: "Re: Complete newbie needs gcc compiler help"
- Reply: Christina: "Re: Complete newbie needs gcc compiler help"
- Reply: Sayantam Dey: "Re: Complete newbie needs gcc compiler help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|