This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cc & gcc


> Date: Fri, 2 Nov 2001 02:31:38 -0500 (EST)
> From: Kai Wang <wk@ocarina.ece.ucsb.edu>
> To: <gcc@gcc.gnu.org>

>    Sorry to bother you guys,but I have a question about gcc.
>   Now I'm working on a SUN work station with both cc and gcc.
>   I have some c++ source files compiled to *.o file using gcc
>   and other c source files compiled to *.o file using cc.My
>  question is : can I use cc to link them together to a excutable?

No, it is of such complexity that you'd be hard pressed to come up
with the exact right incantation to make it work, however, g++ foo.o
bar.o bee.o will just work with no fuss or muss.

If you _must_, then, yes, you can can make it work, but you'd have to
learn a lot of new things.  Compile with g++ -v foo.o bar.o bee.o to
have the compiler instruct you as to exactly how it must be linked.
Then read the cc man page, and see if you can construct a call to cc
that will cause it to call the linker in the same fashion.  If you
become a linker expert, you can even insert a few linker commands to
make it linking with cc easier.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]