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: Compile commands - Chapter 25 example, for example


On 17 December 2011 22:29, Matthew D. Gutchess wrote:
> Hi,
> ? ?I just started using (2011 Dec 16) the gcc compiler which was included with Ubuntu 11.04. ?Can you include compile commands in your manual? ?Compiling the example in Chapter 25 on output buffers, which I called "outbuf1_Josuttis_text.cpp", produced lots of error messages, included below. ?Because this program is made for gcc and listed on the gcc website, I figure that I need a more complex "gcc" command with specific references to the locations of libraries.

You should use g++ to compile C++ programs instead of gcc, as
explained in the manual under "Compiling C++ Programs"

http://gcc.gnu.org/onlinedocs/gcc/Invoking-G_002b_002b.html

"However, the use of gcc does not add the C++ library. g++ is a
program that calls GCC and treats `.c', `.h' and `.i' files as C++
source files instead of C source files unless -x is used, and
automatically specifies linking against the C++ library."


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