Command line error MIDL1005 : cannot find C preprocessor cl.exe

Article ID: 961368 – Last Review: December 19, 2008 – Revision: 1.0

Command line error MIDL1005 : cannot find C preprocessor cl.exe

Source: Microsoft Support

RAPID PUBLISHING

RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.

Action

MIDL could generate MIDL1005 error if it’s not able to find the path of cl.exe while compiling.

Result

midl : command line error MIDL1005 : cannot find C preprocessor cl.exe

Cause

MIDL is not able to find the path for cl.exe from the current executable directory path settings.

Resolution

cl.exe is present under the bin folder of the VC installation directory.  By default, this will be something like this:
C: Program Files Microsoft Visual Studio 8 VC bin.

To include this path, just navigate in the IDE menu to Tools | Options | Projects and Solutions | VC++ Directories, and add $(VCInstallDir)bin to the Executable files list of directories.

More Information

Given a normal and error-free installation of Visual Studio, this entry will have already been added.  However, in some support cases, we have found it to have been missing. The cause of this has not yet been identified, but it has been extremely rare.

VC++ Directories, Projects and Solutions, Options Dialog Box (http://msdn.microsoft.com/en-us/library/t9az1d21.aspx)

DISCLAIMER

MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.


APPLIES TO
  • Microsoft Visual Studio 2005 Standard Edition
  • Microsoft Visual Studio 2005 Professional Edition
  • Microsoft Visual Studio 2005 Team Suite
  • Microsoft Visual Studio 2005 Service Pack 1
  • Microsoft Visual Studio 2008 Standard Edition
  • Microsoft Visual Studio 2008 Professional Edition
  • Microsoft Visual Studio Team System 2008 Team Suite
  • Microsoft Visual Studio 2008 Service Pack 1
Keywords: 
kbnomt kbrapidpub KB961368

 

Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image