Hernan Berinsky wrote:

> Hello!,
>         I want to code in C++ with gcc (using cin, cout, classes, etc.), in Turbo
> C++ I include iostream.h, but I didn�t found it in /usr/include/..
>         How can I compile a C++ source?
>         Thanks in advance!
>
>         Hernan.


Use the g++ compiler... And, "iostream.h" is usually located in
"/usr/include/g++/iostream.h"

So, let's say you want to compile the c++ file "foo.cc" on the command line, you can
write:

"$ g++  -I/usr/include/g++/iostream.h   -o foo foo.cc"

although, I think that usually g++ knows where to find "iostream.h" so, you can
probably just simply write:

"$ g++  -o  foo  foo.cc"

.cc is the commonlly used/recognized  extension for C++ source files in  Unix. In
Turbo C++ it was probably
.cpp if I remember correctly.

There is an even simpler way that you can compile "foo.cc" using "make". You can
simply do :

"$ make foo"

and it should compile using make's built in rules PROVIDED that you use the " .cc "
extension on the end of your C++ file. You can also make  using other extensions by
writing your own rules to make the target foo but I don't want to complicate matters
by describing writing "make" rules at this point.

In any event, I hope this is of some help...

/John  <[EMAIL PROTECTED]>


--
email: [EMAIL PROTECTED]
Local mailserver  , remote

Just say no, to the death penalty!


Reply via email to