/Tc, /Tp, /TC, /TP (Specify Source File Type)
This page is specific to:.NET Framework Version:1.12.03.03.54.0
Visual C++ Compiler Options
/Tc, /Tp, /TC, /TP (Specify Source File Type)

The /Tc option specifies that filename is a C source file, even if it does not have a .c extension. The /Tp option specifies that filename is a C++ source file, even if it doesn't have a .cpp or .cxx extension. A space between the option and filename is optional. Each option specifies one file; to specify additional files, repeat the option.

/TC and /TP are global variants of /Tc and /Tp. They specify to the compiler to treat all files named on the command line as C source files (/TC) or C++ source files (/TP), without regard to location on the command line in relation to the option. These global options can be overridden on a single file by means of /Tc or /Tp.

/Tcfilename
/Tpfilename
/TC
/TP
Arguments

filename

A C or C++ source file.

Remarks

By default, CL assumes that files with the .c extension are C source files and files with the .cpp or the .cxx extension are C++ source files.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.

  2. Click the C/C++ folder.

  3. Click the Advanced property page.

  4. Modify the Compile As property.

To set this compiler option programmatically

Examples

The following CL command line specifies that MAIN.c, TEST.prg, and COLLATE.prg are all C source files. CL will not recognize PRINT.prg.

CL MAIN.C /TcTEST.PRG /TcCOLLATE.PRG PRINT.PRG

The following CL command line specifies that TEST1.c, TEST2.cxx, TEST3.huh, and TEST4.o are compiled as C++ files, and TEST5.z is compiled as a C file.

CL TEST1.C TEST2.CXX TEST3.HUH TEST4.O /Tc TEST5.Z /TP
See Also

Reference

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View