Troubleshooting
Problem
This message appears during the compilation of Microsoft Visual® C++ code generated by IBM Rational® Rose®: "Cannot open include file: 'stdafx.h': No such file or directory"?
Cause
As the error message says, the compiler is finding an include statement for the header file "stdafx.h", but can't find the file itself.
Rose is generating the following line: #include "stdafx.h" by default.
#include "stdafx.h"
The file stdafx.h is usually used as a precompiled header file. Precompiled headers help to speed up compilation when a group of files in a project do not change.
Resolving The Problem
If a precompiled header is not used, this include shouldn't get generated in the code. To turn it off, open the Visual C++ Component Properties dialog and in the tab "Includes" delete the text in the "Initial Source Includes".
Another possibility is to create an empty "stdafx.h" file.
For more information about precompiled header files, refer to the Microsoft knowledge base.
Historical Number
152592215
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21131943