I'm having problems setting up Allegro for Visual C++ Express 2008. I followed the directions from here (http://wiki.allegro.cc/index.php?title=Visual_C%2B%2B_Express_2008) and here (http://wiki.allegro.cc/index.php?title=Visual_C%2B%2B_Express_2005).
Anyway, here are some of my errors:
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(28) : error C2146: syntax error : missing ';' before identifier 'fixed'
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(28) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(28) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(30) : error C2146: syntax error : missing ';' before identifier 'fixtorad_r'
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(30) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(30) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(31) : error C2146: syntax error : missing ';' before identifier 'radtofix_r'
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\fixed.h(31) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(33) : error C2146: syntax error : missing ';' before identifier 'x'
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(33) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(34) : error C2146: syntax error : missing ';' before identifier 'u'
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(34) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\users\computer\desktop\allegro\allegro\include\allegro\3d.h(73) : error C2061: syntax error : identifier 'fixed'
Oh yes. And here's the "offending" code.
#include <allegro.h>
int main(void)
{
allegro_init();
set_gfx_mode(GFX_SAFE, 640, 480, 0, 0);
install_keyboard();
//input for players positions
while(!key[KEY_ESC])
textout_ex(screen, font, "Allegro-4.2.2 working in Visual C++ 2008", 1, 12, 11, -1);
//end program
allegro_exit();
return 0;
}
END_OF_MAIN()
It is telling you that "fixed" is not defined. If you look in allegro/fixed.h you'll find that it is defined as:
typedef int32_t fixed;
int32_t is not defined by your system, for whatever reason that may be. int32_t should be defined in astdint.h in the allegro/include directory. alconf.h includes this file, so somehow you did not compile allegro for your compiler. Did you run:
fix.bat msvc8
Thanks. That did it.
Though, I'm now getting an pop-up window saying that it can't find alleg42.dll when I try to run the exe.
So, I put a copy of alleg42.dll in the same file as the exe, and now it works. But I don't think that this is the way that it was intended to be.
You can put it in the same directory as your program, or put it in the windows/system32 directory. That way, any programs that need that version of allegro (or any dll for that matter) will use it. The search order is usually the current directory that the program is ran from then the windows/system32 directory.