R
ron
I have a background in C. I downloaded and installed g++ on my Sun
system and attempted to compile a sample program in C++ and it doesn't
work. The gcc compiler works pretty much out of the box, but the g++
compiler doesn't appear to find everything it needs...
Since im new to c++, I don't know exactly where to get started.
Is there some guidance out there on how one get's started using c++ and
the various object libraries I hear referenced such as gnu's object
library (which I assume was included with the g++ compiler).
The example source came from http://www.yrl.co.uk/~phil/stl/stl.htmlx
as example 4.3.
Please post reply, do not email.
Ron
~> g++ -O example_4_3.cxx -o x
example_4_3.cxx:27: ISO C++ forbids declaration of `ostream' with no
type
example_4_3.cxx:27: `ostream' is neither function nor member function;
cannot
be declared friend
example_4_3.cxx:27: syntax error before `&' token
example_4_3.cxx:35: 'string' is used as a type, but is not defined as a
type.
example_4_3.cxx: In constructor `TaskObject::TaskObject(const char*,
unsigned
int)':
example_4_3.cxx:30: `process_name' undeclared (first use this function)
example_4_3.cxx:30: (Each undeclared identifier is reported only once
for each
function it appears in.)
example_4_3.cxx: At global scope:
example_4_3.cxx:39: syntax error before `&' token
example_4_3.cxx: In function `int main(int, char**)':
example_4_3.cxx:57: `priority_queue' undeclared (first use this
function)
example_4_3.cxx:57: syntax error before `,' token
example_4_3.cxx:64: `task_queue' undeclared (first use this function)
example_4_3.cxx:67: `cout' undeclared (first use this function)
example_4_3.cxx:67: `endl' undeclared (first use this function)
system and attempted to compile a sample program in C++ and it doesn't
work. The gcc compiler works pretty much out of the box, but the g++
compiler doesn't appear to find everything it needs...
Since im new to c++, I don't know exactly where to get started.
Is there some guidance out there on how one get's started using c++ and
the various object libraries I hear referenced such as gnu's object
library (which I assume was included with the g++ compiler).
The example source came from http://www.yrl.co.uk/~phil/stl/stl.htmlx
as example 4.3.
Please post reply, do not email.
Ron
~> g++ -O example_4_3.cxx -o x
example_4_3.cxx:27: ISO C++ forbids declaration of `ostream' with no
type
example_4_3.cxx:27: `ostream' is neither function nor member function;
cannot
be declared friend
example_4_3.cxx:27: syntax error before `&' token
example_4_3.cxx:35: 'string' is used as a type, but is not defined as a
type.
example_4_3.cxx: In constructor `TaskObject::TaskObject(const char*,
unsigned
int)':
example_4_3.cxx:30: `process_name' undeclared (first use this function)
example_4_3.cxx:30: (Each undeclared identifier is reported only once
for each
function it appears in.)
example_4_3.cxx: At global scope:
example_4_3.cxx:39: syntax error before `&' token
example_4_3.cxx: In function `int main(int, char**)':
example_4_3.cxx:57: `priority_queue' undeclared (first use this
function)
example_4_3.cxx:57: syntax error before `,' token
example_4_3.cxx:64: `task_queue' undeclared (first use this function)
example_4_3.cxx:67: `cout' undeclared (first use this function)
example_4_3.cxx:67: `endl' undeclared (first use this function)