【发布时间】:2010-05-31 21:11:22
【问题描述】:
所以出于某种原因,我的 .cpp 文件缺少它的头文件。但我没有在其他任何地方包含头文件。我刚开始,所以我检查了我制作的所有文件
enginuity.h
#ifndef _ENGINE_
#define _ENGINE_
class Enginuity
{
public:
void InitWindow();
};
enginuity.cpp
#include "Enginuity.h"
void Enginuity::InitWindow()
{
}
main.cpp
#include "stdafx.h"
#include "GameProject1.h"
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
code.....
#endif
不知道发生了什么。我得到的错误是
1>c:\users\numerical25\desktop\intro todirectx\gameproject\gameproject1\gameproject1\enginuity.cpp(1) : warning C4627: '#include "Enginuity.h"': skipped when looking for precompiled header use
1> Add directive to 'stdafx.h' or rebuild precompiled header
1>c:\users\numerical25\desktop\intro todirectx\gameproject\gameproject1\gameproject1\enginuity.cpp(8) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
【问题讨论】:
标签: c++ visual-studio visual-studio-2008 visual-c++