BUG: C1083 error occurs when you compile an MFC Extension DLL project (822333)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2003)
  • Microsoft Visual C++ .NET (2002)

SYMPTOMS

In Visual C++ .NET, the Microsoft Foundation Class (MFC) Class Wizard creates header and implementation code for your class, and adds .cpp and .h files to the project. However, when you use the MFC Class Wizard to create a class in an MFC Extension DLL project, you may receive the following error message while compiling the project:
fatal error C1083: Cannot open include file: '<project name>.h': No such file or directory

CAUSE

The MFC Class Wizard incorrectly inserts code in the <classname>.cpp file to include the <project name>.h file.

WORKAROUND

To work around the problem, remove following line of code from the <classname>.cpp file:
#include "<project name>.h"

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Start Microsoft Visual Studio .NET.
  2. On File menu, point to New, and then click Project.
  3. Click Visual C++ Projects under Project Types, and then click MFC DLL under Templates.
  4. In the Name text box, type MyMFCDll, and then click OK.
  5. Click Application Settings.
  6. Under DLL Type, click MFC extension DLL.
  7. Click Finish.
  8. On the Project menu, click Add Class.
  9. Under Templates, click MFC Class, and then click Open.
  10. In the Class Name text box, type MyClass.
  11. Click Finish.
  12. Build the solution. You may receive the compiler error that the "Symptoms" section describes.

Modification Type:MinorLast Reviewed:1/17/2006
Keywords:kbDLL kbwizard kbLangCPP kbbug KB822333 kbAudDeveloper