help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make can not find .cpp file, any general comments or suggestions to


From: Paul D. Smith
Subject: Re: make can not find .cpp file, any general comments or suggestions to debug?
Date: Sun, 7 May 2006 15:05:25 -0400

%% Lin George <address@hidden> writes:

  >> Look in the documentation for your C preprocessor.  Any flag that
  >> appears in that documentation should go in CPPFLAGS.

  lg> I am using Red Hat Linux Shrike 9.0 and gcc as the compiler. I
  lg> thought preprocessor is a part of gcc (compiler) before, but it
  lg> seems that you mean there exists another system program which only
  lg> works as a preprocessor (before gcc compiles).

  lg> Do you know which program in my system is working as an individual
  lg> preprocessor? I would like to read through the document of the
  lg> preprocessor if I know the name of the program.

This is really a question for the GCC mailing lists and documentation,
not here.

However: typically a C compiler is not just one entity, but rather a
collection of tools.  Traditionally the C compiler consisted of a
preprocessor, compiler (turns C code into assembly language), an
assembler (turns assembly into binary object files), and a linker (pulls
together object files and libraries into an executable).

These tools are hidden by a front-end program, like "cc", which invoked
the individual back-end programs in the right order based on command
line arguments.

In more modern compilers sometimes the preprocessor and compiler are
combined into one: this gives you some kinds of efficiencies.  But every
compiler I've ever seen still provides a way to invoke each stage
separately.


The "gcc" (and "g++") programs are such front ends.  The preprocessor
program is usually called "cpp".  In GCC, the compiler is usually called
"cc1".  The assembler is typically "as", and the linker is "ld".  You
can tell the front-end where to stop; for example it can be very useful
and informative, in special situations, to examine the assembly output
that the compiler generates, before it's turned into object code.  And
it can be _VERY_ useful, in many situations, to examine the output of
the preprocessor.

If you run "gcc" with verbose modes enabled you can see the actual
command lines it invokes when it runs each of the individual steps.  The
manual for GCC will tell you have to control which steps are run and not
run.


All GNU program documentation is delivered as Info pages; you should
look for info pages related to the preprocessor.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

[Prev in Thread] Current Thread [Next in Thread]