我想編譯一個需要cmath包含的函數的文件。我不相信我的代碼本身會導致此錯誤,我懷疑配置(即使所有非包含代碼都已註釋,它仍然存在),但不知道發生了什麼問題。我正在64位Windows主機上編譯。除了添加masm build配置外,我不相信我已將任何編譯設置更改爲非默認設置,並且在禁用masm並將目標配置設置爲32位後問題仍然存在。這裏是我生成的輸出:Visual C++編譯器,編譯錯誤stdlib.h
1>...\VStudio\VC\include\stdlib.h(467): error C2062: type 'long' unexpected
1>...\VStudio\VC\include\stdlib.h(467): error C2062: type 'long' unexpected
1>...\VStudio\VC\include\stdlib.h(467): error C2059: syntax error : ')'
1>...\VStudio\VC\include\stdlib.h(468): error C2143: syntax error : missing ';' before '{'
1>...\VStudio\VC\include\stdlib.h(468): error C2447: '{' : missing function header (old-style formal list?)
1>...\VStudio\VC\include\stdlib.h(471): error C2062: type '__int64' unexpected
1>...\VStudio\VC\include\stdlib.h(471): error C2062: type '__int64' unexpected
1>...\VStudio\VC\include\stdlib.h(471): error C2059: syntax error : ')'
1>...\VStudio\VC\include\stdlib.h(472): error C2143: syntax error : missing ';' before '{'
1>...\VStudio\VC\include\stdlib.h(472): error C2447: '{' : missing function header (old-style formal list?)
任何幫助將不勝感激。
編輯:
我發現了麻煩的一行。出乎我的意料,錯誤確實發生在代碼,是從以前的版本繼承了線的故障:
#define abs(a) ((a)<0? -(a):(a))
負責我的問題。
請顯示代碼被包含在哪裏。 –
請發佈您的代碼。 – hmjd
不僅如此,請向我們展示一個展示該問題的小型完整源文件。 –