導航:首頁 > 源碼編譯 > C語言編譯頭文件出錯

C語言編譯頭文件出錯

發布時間:2024-09-07 17:27:22

① C語言編譯出錯

fatal error C1010: unexpected end of file while looking for precompiled header directive
在工程內添加了新文件(當前工程是簡單win32控制台應用,Win32 Console Application添加之後,編譯出現fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe. 錯誤位置提示在新添加的文件中(.h文件),在這種情況下出現這個錯誤,一般是該文件沒有包含StdAfx.h文件,包含即可.

② 關於C語言在編譯時常出現的錯誤有哪些

1、fatal error C1010: unexpected end of file while looking for precompiled header directive。

尋找預編譯頭文件路徑時遇到了不該遇到的文件尾。(一般是沒有#include "stdafx.h")

2、fatal error C1083: Cannot open include file: 'R…….h': No such file or directory

不能打開包含文件「R…….h」:沒有這樣的文件或目錄。

3、error C2011: 'C……': 'class' type redefinition

類「C……」重定義。

4、error C2018: unknown character '0xa3'

不認識的字元'0xa3'。(一般是漢字或中文標點符號)

5、error C2057: expected constant expression

希望是常量表達式。(一般出現在switch語句的case分支中)

6、error C2065: 'IDD_MYDIALOG' : undeclared identifier

「IDD_MYDIALOG」:未聲明過的標識符。

7、error C2082: redefinition of formal parameter 'bReset'

函數參數「bReset」在函數體中重定義。

8、error C2143: syntax error: missing ':' before '{'

句法錯誤:「{」前缺少「;」。

9、error C2146: syntax error : missing ';' before identifier 'dc'

句法錯誤:在「dc」前丟了「;」。

10、error C2196: case value '69' already used

值69已經用過。(一般出現在switch語句的case分支中)

11、error C2509: 'OnTimer' : member function not declared in 'CHelloView'

成員函數「OnTimer」沒有在「CHelloView」中聲明。

12、error C2511: 'reset': overloaded member function 'void (int)' not found in 'B'

重載的函數「void reset(int)」在類「B」中找不到。

13、error C2555: 'B::f1': overriding virtual function differs from 'A::f1' only by return type or calling convention

類B對類A中同名函數f1的重載僅根據返回值或調用約定上的區別。

14、error C2660: 'SetTimer' : function does not take 2 parameters

「SetTimer」函數不傳遞2個參數。

15、warning C4035: 'f……': no return value

「f……」的return語句沒有返回值。

16、warning C4553: '= =' : operator has no effect; did you intend '='?

沒有效果的運算符「= =」;是否改為「=」?

17、warning C4700: local variable 'bReset' used without having been initialized

局部變數「bReset」沒有初始化就使用。

18、error C4716: 'CMyApp::InitInstance' : must return a value

「CMyApp::InitInstance」函數必須返回一個值。

19、LINK : fatal error LNK1168: cannot open Debug/P1.exe for writing

連接錯誤:不能打開P1.exe文件,以改寫內容。(一般是P1.Exe還在運行,未關閉)

20、error LNK2001: unresolved external symbol "public: virtual _ _thiscall C……::~C……(void)"

連接時發現沒有實現的外部符號(變數、函數等)。

function call missing argument list 調用函數的時候沒有給參數。

member function definition looks like a ctor, but name does not match enclosing class 成員函數聲明了但沒有使用

unexpected end of file while looking for precompiled header directive 在尋找預編譯頭文件時文件意外結束,編譯不正常終止可能造成這種情況

③ C語言,頭文件總是無法在編譯中出錯

可能是你編譯器設置的問題,看看設置的預設目錄是否正確。另外當前目錄包含頭文件用雙引號不用尖括弧即:

#include "stdint.h"

閱讀全文

與C語言編譯頭文件出錯相關的資料

熱點內容
安卓路由表怎麼看 瀏覽:74
10個小孩分糖果python 瀏覽:823
安卓app小紅點怎麼取消 瀏覽:286
馬哥linux面授 瀏覽:768
2345程序員 瀏覽:371
怎麼開啟網速顯示安卓 瀏覽:204
索尼950app怎麼樣 瀏覽:391
計算機畢設論文源碼 瀏覽:148
小米手機怎麼下載易媒體App 瀏覽:191
還原系統設計可以怎樣清理文件夾 瀏覽:670
北京時間校準伺服器雲伺服器 瀏覽:844
pythonexcel數據計算 瀏覽:49
內醫附院黨建APP怎麼下載 瀏覽:356
榮耀v20刷加密門禁卡 瀏覽:329
app緩沖視頻怎麼保存在手機 瀏覽:433
廣度優先演算法c語言 瀏覽:680
提高程序員競爭力 瀏覽:108
nfc可以開加密門卡嗎 瀏覽:675
如何知道網頁使用的伺服器是什麼 瀏覽:224
單片機接反電源會燒嗎 瀏覽:287