[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: gcc-3.0 and C++



On Tue, Nov 20, 2001 at 05:39:12PM +0000, Jason Williams wrote:
> Fair enough; it's just that "old" gcc never seemed to require that.
> Presumably I was incorrect in relying on that behaviour.

Yes.  :-)

Some library functions are implicitly called by the compiler/linker/runtime.
Older versions of GCC had bundled all those C++ support functions[*] in
with the rest of the compiler support library, which was automatically
passed to the linker.

The fact that we'd like to allow vendors such as Debian do upgrades of
certain .so files without breaking backwards compatibility means that those
support functions needed to be decoupled from other irrelevent functions
(such as the compiler's own support code).  Thus, different libraries.

You can still use the main compiler driver ("gcc") to compile your source
code.  But when you go to link, it's best if you use g++.  Depending on
what you're doing during linking, there can be some big differences in
the options passed to the other tools.

[*] By "all those" it sounds like a lot, but it's only a few.


> jason@cds020:~$ cat quicktest.cpp
> int main(void)
> {
>  int *x = new int;
>  delete x;
> }

Yep, new and delete turn into function calls.  The default implementation
is in an external library.

Luck++;
Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



Reply to: