Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Dev-C++ compile error - [Build Error]

This thread is locked; no one can reply to it. rss feed Print
Dev-C++ compile error - [Build Error]
ubernoob
Member #8,038
November 2006

This problem is fixed, it was just a little problem with the .exe it was creating.

When I try to compile my code, I get this compile error:

M:\Programming\SandmansDream\Makefile.win [Build Error] [SandmansDream.exe] Error 1

Here is my main code file:

1//The Sandman's Dream main file.
2// Copyright (c) Durnus Productions 2006
3 
4//Standard headers
5#include <iostream>
6#include "allegro.h"
7#include <math.h>
8//My headers
9#include "particlegrid.h"
10#include "sanddraw.h"
11 
12 
13int size;
14 
15const int WALL = 1;
16const int SAND = 2;
17const int WATER = 3;
18 
19int currentelement;
20 
21int main()
22{
23
24 allegro_init();
25 install_keyboard();
26 install_mouse();
27
28 currentelement = WALL;
29
30
31 size = 5;
32 set_color_depth(8);
33 set_gfx_mode( GFX_AUTODETECT_WINDOWED, 800, 600, 0, 0);
34
35 show_mouse(screen);
36
37 particles parts;
38
39 set_window_title("Sandman's Dream");
40 parts.sand = create_bitmap(600,600);
41 parts.init_particle_grids();
42
43 BITMAP* interface;
44
45 while(!key[KEY_ESC])
46 {
47 if(key[KEY_0_PAD])
48 {
49 currentelement = 0;
50 }
51 if(key[KEY_1_PAD])
52 {
53 currentelement = WALL;
54 }
55 if(key[KEY_2_PAD])
56 {
57 currentelement = SAND;
58 }
59 if(key[KEY_3_PAD])
60 {
61 currentelement = WATER;
62 }
63
64 if(key[KEY_1])
65 {
66 size = 1;
67 }
68 if(key[KEY_2])
69 {
70 size = 2;
71 }
72 if(key[KEY_3])
73 {
74 size = 5;
75 }
76 if(key[KEY_4])
77 {
78 size = 10;
79 }
80 if(key[KEY_5])
81 {
82 size = 15;
83 }
84 if(key[KEY_6])
85 {
86 size = 25;
87 }
88 if(key[KEY_6])
89 {
90 size = 50;
91 }
92
93 if(mouse_b & 1 && mouse_x < 600)
94 {
95 parts.draw_particle(currentelement, mouse_x,mouse_y, size);
96 }
97 if(mouse_b & 1 && mouse_x > 600)
98 {
99
100 }
101 parts.calculate_particles();
102 parts.draw_parts();
103 parts.refresh_grid();
104 blit(parts.sand,screen,0,0,0,0,600,600);
105
106 rest(10);
107 }
108}
109END_OF_MAIN();

If you know what is wrong (or want the other files) please post. :P

Matthew Dalrymple
Member #7,922
October 2006
avatar

Try installing the timer:

The manual under show_mouse() says:

The Manual said:

This will only work if the timer module has been installed.

The manual also says under install_timer()

The Manual said:

You must do this before installing any user timer routines, and also before displaying a mouse pointer, playing FLI animations or MIDI music, and using any of the GUI routines.

And also you can do this:
#include <allegro.h>
instead of:
#include "allegro.h"

I hope that fixes it.

=-----===-----===-----=
I like signatures that only the signer would understand. Inside jokes are always the best, because they exclude everyone else.

ubernoob
Member #8,038
November 2006

Thanks, but I'm afraid it didn't work. :'(

I tried what you said, but I still get the same compile errors.

EDIT: Hmm... there were some files in the project folder that I lost permissions to... tried to fix, couldn't, so I renamed them. Now it works! :P

Go to: