This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: What is translation unit
- From: John Love-Jensen <eljay at adobe dot com>
- To: mahmoodn <nt_mahmood at yahoo dot com>, MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 10 Dec 2007 06:25:43 -0600
- Subject: Re: What is translation unit
Hi mahmoodn,
> What is translation unit and how can I determine how many translation unit
> my code have? :confused:
Let's say you have three source code files, foo.cpp, bar.cpp and baz.cpp.
Here are the three translation units, which translate from the source file
to the object file.
g++ -c foo.cpp -o foo.o
g++ -c bar.cpp -o bar.o
g++ -c baz.cpp -o baz.o
When linking the object files together, that process is not a translation
unit.
g++ foo.o bar.o baz.o -o quux
HTH,
--Eljay