#include problems, Allegro

Hey i need help! Im making a game in Dev-C++ and im programming in c++, allegro. When i try to include some other libraries like iostream, fstream and sstream it rejects it and gives me a very wierd error. Please help!

Source code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#define down 0;
#define left 32;
#define right 64;
#define up 96;

#include <allegro.h>
#include <iostream>

int startup();

int main()
{
	startup();
	BITMAP *buffer = create_bitmap(800, 600);
	BITMAP *bg = load_bitmap("bg.bmp", NULL);
	BITMAP *sprite = load_bitmap("player.bmp", NULL);
	
	int x,y;
	x = 100;
	y = 100;
	int imageX = 32;
	int imageY = down;
	
	while(!key [KEY_ESC])
	{
		if(key[KEY_D])
		{
			imageY = right;
			x += 1;
		}
		else if(key[KEY_A])
		{
			imageY = left;
			x -= 1;
		}
		else if(key[KEY_W])
		{
			imageY = up;
			y -= 1;
		}
		else if(key[KEY_S])
		{
			imageY = down;
			y += 1;
		}
		if(key[KEY_S] && key[KEY_LSHIFT])
			y += 1;	
		else if(key[KEY_W] && key[KEY_LSHIFT])
			y -= 1;
		else if(key[KEY_D] && key[KEY_LSHIFT])
			x += 1;
		else if(key[KEY_A] && key[KEY_LSHIFT])
			x -= 1;
		if(!key [KEY_S] && !key [KEY_W] && !key [KEY_A] && !key [KEY_D])
			imageX = 32;
		else
		{
			rest(5);
			imageX += 32;
		}
		if(imageX > 64)
			imageX = 0;
		blit(bg, buffer,0,0,0,0, bg->w, bg->h);
		masked_blit(sprite, buffer, imageX, imageY, x, y, 32, 32);
		blit(buffer, screen,0,0,0,0, buffer->w, buffer->h);
		clear(buffer);
	}
	clear(screen);
	destroy_bitmap(buffer);
	destroy_bitmap(bg);
	destroy_bitmap(sprite);
	return 0;
}
END_OF_MAIN();


The error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Compiler: Default compiler
Building Makefile: "C:\GameProject\Game\Makefile.win"
Executing  make...
make.exe -f "C:\GameProject\Game\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include"  -I"C:/Dev-Cpp/include/c++/3.4.2/backward"  -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32"  -I"C:/Dev-Cpp/include/c++/3.4.2"  -I"C:/Dev-Cpp/include"   

In file included from C:/Dev-Cpp/include/c++/3.4.2/ios:49,
                 from C:/Dev-Cpp/include/c++/3.4.2/ostream:45,
                 from C:/Dev-Cpp/include/c++/3.4.2/iostream:45,
                 from main.cpp:7:

C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:231: error: expected unqualified-id before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:231: error: expected unqualified-id before '=' token
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:238: error: expected unqualified-id before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:238: error: expected unqualified-id before '=' token

C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:868: error: expected unqualified-id before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:868: error: expected init-declarator before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:868: error: expected `,' or `;' before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:868: error: expected `)' before '&' token
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:868: error: expected `,' or `;' before '&' token
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:876: error: expected unqualified-id before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:876: error: expected init-declarator before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:876: error: expected `,' or `;' before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:876: error: expected `)' before '&' token
C:/Dev-Cpp/include/c++/3.4.2/bits/ios_base.h:876: error: expected `,' or `;' before '&' token

In file included from C:/Dev-Cpp/include/c++/3.4.2/locale:47,
                 from C:/Dev-Cpp/include/c++/3.4.2/bits/ostream.tcc:40,
                 from C:/Dev-Cpp/include/c++/3.4.2/ostream:545,
                 from C:/Dev-Cpp/include/c++/3.4.2/iostream:45,
                 from main.cpp:7:
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc: In member function `_OutIter std::money_put<_CharT, _OutIter>::_M_insert(_OutIter, std::ios_base&, _CharT, const std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT> >&) const':
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1672: error: expected unqualified-id before numeric constant

C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1672: error: expected `)' before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1672: error: expected primary-expression before ')' token
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1672: error: expected `;' before ')' token
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1675: error: expected primary-expression before "else"
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:1675: error: expected `;' before "else"

C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc: In static member function `static void std::__pad<_CharT, _Traits>::_S_pad(std::ios_base&, _CharT, _CharT*, const _CharT*, std::streamsize, std::streamsize, bool)':
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:2448: error: expected unqualified-id before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:2448: error: expected `)' before numeric constant
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:2448: error: expected primary-expression before ')' token
C:/Dev-Cpp/include/c++/3.4.2/bits/locale_facets.tcc:2448: error: expected `;' before ')' token

make.exe: *** [main.o] Error 1

Execution terminated 
Don't use Dev-C++.
http://www.cplusplus.com/articles/36vU7k9E/

Don't use Allegro. It's a C library. Use SFML instead:
http://www.sfml-dev.org/

Don't use #define. Use constants instead.
But ive learned allegro and i can use it with c++, And what is SFML? I've learned too much allegro to just switch it. Can you maybe help me on learning because right now the whole game programming for me will be turned upside-down if i switch.
Woah! Don't stop using Allegro. Allegro is a awesome lib to use in C++. I don't know what he's talking about. A lot of people use Allegro in C++.

I would use VS2010. Very good complier. Dev-C++ is very outdated.

:)
Topic archived. No new replies allowed.