Re: g++ vs g77 ?


Subject: Re: g++ vs g77 ?
From: Stephen Edie (sedie@terraplex.com)
Date: Fri Feb 25 2000 - 16:35:23 MST


Vanja,

You are asking gcc to compile and link the program in the same step. GCC
passes files to the linker in the same order that you specify them. Your
first commandline has "-lmoto" listed before prog.cc. So, the linker which
reads files in reverse of the order they appear on the command line is
probably reporting unresolved symbols in prog.cc. Where you put -O2 on
the command line should be irrelevent, but keep in mind the library/module
ordering issue.

Stephen

Terra Soft Solutions, Inc.
 Yellow Dog Linux
 "The Ultimate Companion for a Dedicated Server"
 http://www.yellowdoglinux.com/

 Black Lab Linux
 Workstations and advanced, Parallel Solutions
 http://www.blacklablinux.com/

On Fri, 25 Feb 2000, Vanja Bucic wrote:

>
> Is it just me that didn't know that man page for g++(gcc, g77) is
> incorrect, or it is something specific to YellowDog.
> When you invoke the compiler in a manner the man page instructs you to
> do it, it disregards any of the flags present on the command line. Man
> page { usage -> g++ [options | filename]..}
> Example:
> g++ -L. -lmoto -O2 prog.cc will produce the same thing as
> g++ prog.cc
>
> but if you do this
> g++ prog.cc -L. -lmoto -O2
> only then it will do the proper job (including the libraries and doing
> the optimizations).
>
> I always thought that order did not matter.
> Am I reading the man page incorrectly???
> A lot of Makefiles will have to be changed on my side.
>



This archive was generated by hypermail 2a24 : Wed Mar 01 2000 - 00:07:02 MST