www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/18/15:44:31

Sender: nate AT cartsys DOT com
Message-ID: <362A4387.5446E603@cartsys.com>
Date: Sun, 18 Oct 1998 12:37:43 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Why doesn't iostream work??
References: <36228A92 DOT 62A6B474 AT lycosmail DOT com> <362556CA DOT B94B6E96 AT winchendon DOT com> <36260CEB DOT 6C6B6D64 AT montana DOT com> <36290FD4 DOT 94509A19 AT winchendon DOT com>
Reply-To: djgpp AT delorie DOT com

Eric Weiss wrote:
> 
> Thanks for the suggestion.  That was all I needed to do.  The quick
> start/readme documentation does not mention this is how you get C++,

Did you miss this bit in README.1ST?

# To link a C++ program, use gxx instead of gcc, like this:
# 
#         gxx -o myprog.exe mymain.o mysub1.o mysub2.o


> although there is mention that gcc will automatically use C++ on .cpp
> files. 

It will, when compiling.  But when linking (creating the executable),
often all GCC sees is .o files, for which C and C++ are
indistinguishable.  Thus, it needs to be told to scan the C++ libraries,
which is why you use `gxx'.

> I guess I've done it with Unix too long.

Most Unix systems I've seen also require you to use `c++' or some
variant instead of `cc' when linking C++, for the same reason as above.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019