The information in this article applies to:
SUMMARYWhen compiling multiple .CPP or .CXX files using a wildcard syntax and the /Tc command line option, for example
the C compiler is invoked only for the first source file matching the
wildcard specification. For all subsequent files, the C++ compiler is
invoked. The inverse is also true. That is, when compiling multiple .C
files using a wildcard syntax and the /Tp command line option, the C++
compiler is invoked only for the first file; for all subsequent files, the
C compiler is invoked.
CAUSEThis behavior is by design. As stated in the online and hard copy documentation for Microsoft C/C++ version 7.0 and all versions of Microsoft Visual C++ 16- and 32-bit Editions, the following is the correct syntax for the /Tc and /Tp command line options:
Each option refers to only one source file. Therefore, the first file
matching the wildcard specification will be compiled as directed by the
corresponding /T? option. All other files matching the wildcard will be
compiled in accordance with their extension. (The C compiler is invoked for
.C files, the C++ compiler for .CPP or .CXX files.)
MORE INFORMATIONThe following are two possible workarounds for the potential inconvenience presented by this behavior:
-or- Sample CodeIf you wish to compile file1.c, file2.c and file3.c with the C++ compiler and link them to create exefile.exe, use the following makefile:
Additional query words: 8.00 8.00c 9.00
Keywords : kbCompiler kbVC100 kbVC150 kbVC200 kbVC210 kbVC400 kbVC410 kbVC420 kbVC500 |
Last Reviewed: July 6, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |