This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cc & gcc
- To: gcc at gcc dot gnu dot org, wk at ocarina dot ece dot ucsb dot edu
- Subject: Re: cc & gcc
- From: mike stump <mrs at windriver dot com>
- Date: Fri, 2 Nov 2001 13:22:53 -0800 (PST)
> 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.