2017-01-24 42 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”等简单名称的头文件,请尝试将它们重命名为其他名称。