1、報錯
這裏的錯誤是,你包含了頭文件 #include “stdafx.h” 產生所產生的,大概你是創建的空項目,卻包含了這個頭文件。
2、解決辦法
辦法一
將頭文件替換掉(建議此種做法,較簡單);查看 “stdafx.h” 所包含的內容爲:
#include <stdio.h>
#include <tchar.h>
- 1
- 2
- 1
- 2
這裏只需將你的 ,#include “stdafx.h” 刪除掉。更換爲 其所包含的內容。也就是:
#include <stdio.h>
#include <tchar.h>
- 1
- 2
- 1
- 2
辦法二:
在你項目中,找到頭文件,添加頭文件,名爲:stdafx.h :添加成功後,單擊並添加內容:
#include <stdio.h>
#include <tchar.h>
- 1
- 2
- 1
- 2
保存,再行編譯,錯誤解決~