Saturday, July 17, 2010

How to complile only hello.c with gcc?
: use -c option to say not to run the linker.
: ex) gcc -c hello.c

gcc uses cpp0, cc1, as, collect2.
cpp0 = pre-processor,
cc1 = compiler,
as = assembler,
collect2 = linker.

What is the extension of shared library and static library?
: static library is .a
: shared library is .so

2 comments:

  1. When you invoke GCC, it normally does preprocessing, compilation,
    assembly and linking. The "overall options" allow you to stop this
    process at an intermediate stage. For example, the -c option says not
    to run the linker. Then the output consists of object files output by
    the assembler.

    ReplyDelete
  2. To view process in compile use -v option.
    you can view pre-process, compile, asselble, link processes.

    ReplyDelete