Allegro in VCPP 9.0

i went to tools>options>projects & solutions> vc++ directories> show directories for: library files> added the directory to the lib inside the AllegroFORVCPP9 file that i downloaded here> http://www.allegro.cc/files/

i did the same for the include files.

I put in this code:

1
2
3
4
5
6
7
8
9
10
11
12
13
#include "stdafx.h"
#include <allegro.h>


int _tmain(int argc, _TCHAR* argv[])
{
allegro_init(); // Initialize Allegro
install_keyboard(); // Initialize keyboard routines
set_gfx_mode(GFX_AUTODETECT, 640,480,0,0); // Change our graphics mode to 640x480
readkey();// Wait untill a key is pressed
	return 0;
}
END_OF_MAIN()



I got this error report

1
2
3
4
5
6
7
8
Compiling...
stdafx.cpp
Compiling...
projectafaff.cpp
c:\documents and settings\adrian\mis documentos\visual studio 2008\projects\projectafaff\projectafaff\projectafaff.cpp(16) : error C2065: '_mangled_main' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Adrian\Mis documentos\Visual Studio 2008\Projects\projectafaff\projectafaff\Debug\BuildLog.htm"
projectafaff - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========




What am I doing wrong?


**********************************************************
Problem Solved: I just followed the steps at
http://wiki.allegro.cc/index.php?title=Visual_C%2B%2B_Express_2005#Setting_up_a_Project

Code changed a little:
1. the include statements both use quotations
2. i use a standard main since End_Of_Main defines a mangled main (see link provided)
Last edited on
So declare _mangled_main. And I think that line
#include <allegro.h>
must be also with quotes
#include "allegro.h", because it is user defined.
How do I decalre _mangled_main?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
what i did:

#include "stdafx.h"
#include "allegro.h"


int _mangled_main(int argc, _TCHAR* argv[])
{
allegro_init(); // Initialize Allegro
install_keyboard(); // Initialize keyboard routines
set_gfx_mode(GFX_AUTODETECT, 640,480,0,0); // Change our graphics mode to 640x480
readkey();// Wait untill a key is pressed
	return 0;
}
END_OF_MAIN()


This gave me a bigger error report.
Last edited on
Just put a ; after END_OF_MAIN() and press ENTER.

~psault
psault (94) Jan 26, 2009 at 10:38pm
Just put a ; after END_OF_MAIN() and press ENTER.

~psault


No.
I apologize, I had thought I'd received a similar error when I left END_OF_MAIN(); off of my game one time.

I think it's a macro and doesn't require a ;

~psault
Topic archived. No new replies allowed.