Everything2
Near Matches
Ignore Exact
Full Text
Everything2

C++: no compilers available

created by ariels

(idea) by ariels (4.3 d) (print)   ?   (I like it!) 1 C! Sat Jan 20 2001 at 9:26:31

So you've finally written your very own C++ program. And you've heeded all the words of the C++ gurus: it uses STL containers and iterators (although you're careful not to inherit from these, for various arcane reasons). It just remains to compile your masterpiece. Should be easy enough -- after all, you were careful to write a standards-compliant program.

Umm, sorry. Did you say "compile"?!

That might be a bit tricky...

You see, you're writing C++. And there don't actually exist any C++ compilers. MS VC++ (that's Visual C++) is said not to support member function templates, which are required to write many useful template classes. This also means it cannot compile the STL. Sun's CC compiler is "getting better all the time". In English, this means it's not there yet. The same for any other UN*X vendor's compiler that I've touched (usually with a long pole) so far.

So you can use GNU gcc. Get the very very latest version (2.95.2; here "odd second number" doesn't mean unstable, but that's a fault of lack of stable systems for version numbers rather than C++). The compiler is nearer the standard than any other mainstream compiler. But the library still isn't C++, especially in iostreams (that's I/O for all you non-standards-compliant folk). It is said you can compile STLport with gcc to get something very close to the standard. But still, "compiling" is not the same as "conforming". And gcc gets something as simple as

class A {
  private:
    class B {
      // ...
    public:
      B() { ... };
    };
  // ...
};

A::B ab;       // illegal, since "class B" is private in A!
wrong! It agrees to compile this, when A::B may only be used inside A and its friends, as it's private. So much for hiding implementation details in your library.

Then there are somewhat more exotic things you can try, like KAI's compiler or Comeau C++. They seem to be seeking the standard, but still aren't there (yet).

AND, all these cross-platform compilers can leave much to be desired performance-wise. Because, you see, gcc produces suboptimal code on many architectures (like DEC alphas or SGI's R10000). And it's doubtful how well-tuned a vendor- and compiler-neutral implementation of the STL will be. Of course, the whole idea of writing standard code is that it will compile well on any platform that supports the standard.

Too bad there aren't any.


printable version
chaos

The C++ Programming Language Freakshow C++: how big is nothing? Do not cash the refund check how video games are programmed
extern "C" iterator Visual C++ Kai
malloc pooling GCC The History of Borland Delphi An important sentence to know when going abroad
Object Orientation in ANSI C arcane Nothing says hardcore like Kansas in January: an Everything, Kansas proof of concept Microsoft Visual C++
function template computer science Java Turbo C
John Thomas Cholmondeley-Minge Hikaru no Go member function pointer to member function
Y'know, if you log in, you can write something here, or contact authors directly on the site. Create a New User if you don't already have an account.
  Epicenter
Login
Password

password reminder
register

Everything2 Help

Cool Staff Picks
The best nodes of all time:
Bunyip
Rules of program optimization
Thanotropism
A Beginner's Guide to IRC
Aryan Nation
The Backyardigans
John Peel
Cryptic Crossword Clue Types
Dalai Lama
Scenes from a Memory
The Lord's Prayer
Rhapsody on a Windy Night
The name that lasted a million years
New Writeups
octillion369
Frost wyrm(person)
kalen
Three "T"s(idea)
octillion369
Undead(idea)
archiewood
Ico(fiction)
Heisenberg
Why I love Everything2(log)
octillion369
Death Knight(person)
XWiz
Are you hoping for a miracle?(review)
santo
The Host(review)
LostPsion
"Shut the Fuck Up" Theaters(idea)
beatrice
You've been slowly taking me over for nearly a year, do you know that?(idea)
Berek
YouTube(thing)
shaogo
How to Pretend to Have a Job(idea)
hapax
Les Provinciales(review)
zoeb
The Scene(review)
aneurin
Telephone Numbers for drama purposes(idea)
E2 is a by-product of the existence of The Everything Development Company