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: Lin George
Subject: Re: make can not find .cpp file, any general comments or suggestions to debug?
Date: Wed, 3 May 2006 21:59:42 -0700 (PDT)

Thanks Greg,


A great answer! I often use -I -D -l -L to
compile/build program/shared library. Do you have any
comments or suggestions about whether I should add -I
(-D, -l and -L) to CXXFLAGS or CPPFLAGS?

What about other options -Wall, -Wl, ... etc.


regards,
George

--- Greg Chicares <address@hidden> wrote:

> On 2006-5-3 12:42 UTC, Lin George wrote:
> > 
> > I have read through the section you recommended,
> but I
> > can not find the relationship between CXXFLAGS and
> > CPPFLAGS (for example, CXXFLAGS includes CPPFLAGS)
> --
> 
> $(CXXFLAGS) doesn't "include" $(CPPFLAGS). They're
> distinct.
> 
> The convention is to use them both together for C++.
> To build a C++
> program, traditionally at least three tools are
> needed, and each has
> its own flags for flexibility and clarity:
>   $(CPPFLAGS) for $(CPP), the C preprocessor
>   $(CXXFLAGS) for $(CXX), the C++ compiler
>   $(LDFLAGS)  for $(LD),  the linker
> 
> 10.2 Catalogue of Implicit Rules
> | Compiling C++ programs
> |   n.o is made automatically from n.cc, n.cpp, or
> n.C with a command
> |   of the form `$(CXX) -c $(CPPFLAGS) $(CXXFLAGS)'.
> 
> > to my surprise, instead I found that CPPFLAGS is
> used
> > for C (not C++)?
> 
> C++ uses the C preprocessor. That's part of the
> language's definition.
> 
> 14.3 Variables for Specifying Commands
> | Use CPPFLAGS in any compilation command that runs
> the preprocessor
> 
> > Here is the original text from GNU
> > make manual,
> > 
> > --------------------
> > CXXFLAGS Extra flags to give to the C++ compiler.
> > CPPFLAGS Extra flags to give to the C preprocessor
> and
> > programs that use it (the C and
> > Fortran compilers).
> > --------------------
> 
> Read the parenthetical statement as:
>   (for example, the C, C++, and Fortran compilers)
> 
> I'm not sure it's possible to list every language
> that uses the C
> preprocessor, though. Perhaps "Objective C" does; I
> wouldn't know.
> How about Walter Bright's "D" language? Or "C with
> Classes"?
> Or "B"? Or "BCPL"?
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




reply via email to

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