DOCUMENT:Q142421 31-JUL-2001 [visualc] TITLE :FIX: D2004 Caused by /Tp or /Tc Option in Visual C++ 4.0 PRODUCT :Microsoft C Compiler PROD/VER:winnt: OPER/SYS: KEYWORDS:kbide kbVC kbVC400bug kbVC410fix ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual C++, 32-bit Enterprise Edition, version 4.0 - Microsoft Visual C++, 32-bit Professional Edition, version 4.0 - Microsoft Visual C++, 32-bit Learning Edition, version 4.0 ------------------------------------------------------------------------------- SYMPTOMS ======== If the /Tp or /Tc compiler option is used in a project built within the Developer Studio, one of the following errors occurs: Command line error D2004 : '/Tp' requires an argument -or- Command line error D2004 : '/Tc' requires an argument RESOLUTION ========== To work around the problem: - Build the project from the command line. For example: nmake /f NOTE: You may need to run Vcvars32.bat from the \Msdev\Bin directory to set up the environment variables needed to build from the command line. -or- - Rename the source files to have the needed extension so the /Tp or /Tc option is not needed. STATUS ====== Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1. MORE INFORMATION ================ The /Tc option specifies that the file is a C source file, even if it doesn't have a .c extension. The /Tp option specifies that the file is a C++ source file, even if it doesn't have a .cpp or .cxx extension. These options worked for projects built within the Visual C++ 2.x environment. If you convert a project from version 2.x to 4.0 that has these options, you will get the previously described error. Additional query words: ====================================================================== Keywords : kbide kbVC kbVC400bug kbVC410fix Technology : kbVCsearch kbVC400 kbAudDeveloper kbVC32bitSearch Version : winnt: Issue type : kbbug Solution Type : kbfix ============================================================================= THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY. Copyright Microsoft Corporation 2001.