www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/05/03:48:28

Date: Mon, 5 Jan 1998 10:44:08 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: John Machin <sjmachin AT lexicon DOT net DOT au>
cc: djgpp AT delorie DOT com
Subject: Re: Book "Practical C++ Programming" / examples / DJGPP format
In-Reply-To: <199801042040.HAA23345@mona.lexicon.net.au>
Message-ID: <Pine.SUN.3.91.980105104349.14443C-100000@is>
MIME-Version: 1.0

On Mon, 5 Jan 1998, John Machin wrote:

>     (b) CC = gxx

This would be the best alternative, provided that $(CC) is always used
to both compile and link in one step.  If $(CC) is used for
compilation alone (-c switch), then use gcc instead (gxx will print a
warning, which is harmless but annoying).

> (2) File extension conflict (files are called foo.cpp, makefile uses 
> foo.cc)

It's best to rename the files.  See below.

> (2) Which is a "better" naming convention to use for C++ source 
> files generally, foo.cc or foo.cpp?

foo.cc will avoid a bug in the current version of gcc which makes it
hard to debug the program.  If you don't care about debugging with one
of the DJGPP debuggers, you can use foo.cpp.

> (3) Has Q2 just started a holy war?

No.

> (4) As most of the examples involve a single source file, I think 
> I'll just write a mak.bat that compiles & links the %1.cc or %1.cpp 
> file, and fiddle the remaining makefiles by hand; this will save some 
> disk space; any comments?

Good luck!

> Here's the (very minor) FAQ bug:
> 
> > The Standard C++ Template classes are in `libstdcx.a' (it's called 
> > `libstdc++.a' on Unix); append `-lstdcxx.'
>                                          ^

That's not a bug, that's a feature ;-).

Seriously, though, the names libstdc++.a and libstdcxx.a exceed the
DOS 8+3 limits.  When gcc sees -lstdcxx it generates the name
libstdcxx.a and instructs the linker to look for it.  DOS silently
truncates that name into libstdcx.a, and everything works.

But users should still use the long name, or else they will get bad
habits that will bite them on Unix.  So that part of the FAQ uses
"-lstdcxx" on purpose.

If you work on Windows 95, you need to rename you C++ class libraries:

	libiostr.a -> libiostream.a
	libstdcx.a -> libstdcxx.a

The reason for this is that the DJGPP port of the GNU C++ libraries
was done before long file names were supported, and the zip archives
are therefore not LFN-clean.

- Raw text -


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