public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* compiling c and c++ source same time
@ 2002-03-15  6:57 Suman Kumar Ray
  0 siblings, 0 replies; 2+ messages in thread
From: Suman Kumar Ray @ 2002-03-15  6:57 UTC (permalink / raw)
  To: gcc-help

Hello,
 I have a requirement that if a directory contains
c and c++ sources, c files will be compiled by c
compiler and c++ by c++ compiler. I can handle it
through script, but I am curious to know if I use
gcc for compiling all files and g++ for linking all
object files, can gcc handle compilation of c++ files
for all scenario. In gcc manuals it says
"GCC recognizes files with these names and compiles
them as C++ programs ... However, C++ programs often
require ... a compiler that understands the C++
language". Does it mean, compiling (not linking) a c++
file by gcc and by g++ is not same thing ?
 Thanks in advance.
-
Suman Kumar Ray

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: compiling c and c++ source same time
@ 2002-03-17 22:39 Suman Kumar Ray
  0 siblings, 0 replies; 2+ messages in thread
From: Suman Kumar Ray @ 2002-03-17 22:39 UTC (permalink / raw)
  To: gcc-help

Alex,
   I am using g++ as linker mainly because it will add
all c++ library by default, whereas if I use gcc, I
have to explicitly pass those libraries in option. At
least this behavior, I have found in cygwin. My doubt
is when we can't use gcc as a compiler for c++ file. I
mean, I have seen e.g. if I use class etc. in file
a.C, and if I say gcc -c a.C, it can compile the file.
Then as a compiler front end ( not as a linker,
because g++ passes
extra library by default), why do we need g++ ? 
Regards,
Suman
 

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-03-18  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-15  6:57 compiling c and c++ source same time Suman Kumar Ray
2002-03-17 22:39 Suman Kumar Ray

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).