2017-01-24 45 views
0

我試圖在Visual Studio Express 2012中製作與Allegro 5的遊戲,但我保存的舊模板看起來不再起作用。 VS抱怨了很多關於兩個特定的文件,file.h和fmaths.h,抱怨從語法錯誤到未聲明的標識符。這裏是我的錯誤:與Allegro 5的工作程序不再起作用

Error 1 error C2059: syntax error : '__cdecl' c:\allegro5-msvc11\include\allegro5\file.h 33 1 Super Boulder Whisperer 
Error 2 error C2061: syntax error : identifier 'ALLEGRO_FILE' c:\allegro5-msvc11\include\allegro5\file.h 33 1 Super Boulder Whisperer 
Error 3 error C2091: function returns function c:\allegro5-msvc11\include\allegro5\file.h 33 1 Super Boulder Whisperer 
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\allegro5-msvc11\include\allegro5\file.h 33 1 Super Boulder Whisperer 
Error 6 error C2065: 'ERANGE' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 43 1 Super Boulder Whisperer 
Error 7 error C2065: 'ERANGE' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 72 1 Super Boulder Whisperer 
Error 8 error C2065: 'ERANGE' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 95 1 Super Boulder Whisperer 
Error 9 error C2065: 'ERANGE' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 172 1 Super Boulder Whisperer 
Error 10 error C2065: 'ERANGE' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 194 1 Super Boulder Whisperer 
Error 11 error C2065: 'EDOM' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 235 1 Super Boulder Whisperer 
Error 12 error C2065: 'EDOM' : undeclared identifier c:\allegro5-msvc11\include\allegro5\inline\fmaths.inl 246 1 Super Boulder Whisperer 

我不完全相信,有一個問題,我包括和依賴關係,因爲這個程序在同一時間建立完全沒有在同一臺機器上。有任何想法嗎?

+0

轉到輸出窗口而不是錯誤列表,並找出它們最終與哪些文件相關聯。這些包括之前可能會被打破。 (由於錯誤列表沒有顯示任何上下文,所以錯誤列表非常垃圾。) – molbdnilo

+0

似乎在輸出窗口中它的主要問題是file.h(抱怨幾件不同的事情)和fmaths.inl (抱怨未申報的標識符)。不過,這是一個allegro文件,所以我不完全確定實際問題是什麼。 –

+0

您正在使用哪個Allegro版本?在最近的Allegro 5(5.2.2)中查看file.h的第33行,我發現除了通過重新定義'AL_METHOD'宏之外,你不可能得到這些消息。但是你的fmaths.inl中的行號與5.2.2中的代碼不匹配(在任何情況下,你都需要弄清楚*'#include「file.h」'之前會發生什麼*。文件在輸出中。) – molbdnilo

回答

0

修改我的包含目錄後,我遇到了一個非常類似的問題。在檢查構建輸出日誌以查看哪個文件被責備之後,我注意到它抱怨一個頭文件甚至沒有被該文件包括在內。

事實證明,我的一個頭文件與Allegro包含的頭文件名稱相同,添加到我的包含目錄中的新路徑在查找文件時優先考慮。它包含了我的頭文件,而不是Allegro實際尋找的。

如果您有任何可能正在使用的名爲「File.h」,「IO.h」等簡單名稱的頭文件,請嘗試將它們重命名爲其他名稱。