This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: G++


Gregor Karzelek wrote:

> How can I say to g++ that he should print out the errors in a
> file not in the stdout (=screen)?

It outputs errors to stderr not stdout. stderr has file descriptor 2;
you could use shell redirects, e.g.:

    g++ -c foo.cc -o foo.o 2>errorfile

> If I want to compile a X.o from a X.cpp shall I use gcc or g++?
> Both do it, but what shall i Rather use?

The main differences between g++ and gcc are that g++ will compile .c
files as if they were C++ and that g++ automatically includes libstdc++
when it is asked to link. You should use g++ for your link step.

Rup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]