Can collect2 just generate the c file?

John Love-Jensen eljay@adobe.com
Fri Jan 13 21:32:00 GMT 2006


Hi Perry,

> Can I call g++ with arguments so that it will generate the source file and
then stop.

Yes, there are two stopping places:

g++ -E foo.cpp -o foo.ii
Stops after the preprocessor.

g++ -S foo.cpp -o foo.s
Stops after the compilation to assembler.

>I assume it is a .c file

No, it is either a .ii (preprocessed) file or a .s (assembler) file.

> I want to call the linker myself.  I think that is going to be easier to do in
my situation.

Ummm... well, to invoke the linker you probably want yet another stopping
place:

g++ -c foo.cpp -o foo.o
Stops after the creation of the .o (object) file.

But that's not a "generate the source file and then stop" kind of stopping
place.

Anyway, remember to use g++ to invoke the linker.  The g++ front end is a
tool-chain driver, and will invoke the linker correctly.

HTH,
--Eljay



More information about the Gcc-help mailing list