newbie c++/ld question
Nix
nix@esperi.demon.co.uk
Tue Apr 17 12:30:00 GMT 2001
On 15 Apr 2001, Michael Shmulevich spake:
> As far as I can remember, similar behaviuor happened to me once, when
> I tried to compile files with g++ and link with ld.
>
>
> I guess you need to link with g++ too...
You should never use `ld' to link; the compiler driver might want to
link with other libraries, call collect2 to repeatedly reinvoke the
linker, or do other things.
You can use the -Wl switch to pass arbitrary options to the linker, so
you lose no flexibility.
You don't need to compile with `g++' at all; it does the same thing as
`gcc'. But you do need to *link* with it, if you have any C++ code in
the program being linked.
--
`... and it's not true that I'm closely related to the three-toed
sloth.' --- Kieran
More information about the Gcc-help
mailing list