adizzle |
06-16-2004 05:07 PM |
Errors when compiling anything!
OK I am a super noob to linux i've just started learning a couple days ago. I am having a big problem though. Whenever I try to compile a program I am getting many different kinds of errors and the program will not install. For example when i try to "make" a game called Moon Defence, I get this:
Code:
alexjh@linux:~/Desktop/moondefence-1.5> make
g++ -c main.cpp -o main.o -fno-access-control -fexpensive-optimizations -O3
In file included from main.cpp:3:
objects.h:6:21: allegro.h: No such file or directory
In file included from main.cpp:3:
objects.h:46: error: syntax error before `*' token
objects.h:51: error: type specifier omitted for parameter `BITMAP'
objects.h:51: error: syntax error before `*' token
objects.h:55: error: `BITMAP' was not declared in this scope
objects.h:55: error: `dest' was not declared in this scope
objects.h:55: error: invalid data member initialization
objects.h:55: error: (use `=' to initialize static data members)
objects.h:55: error: variable or field `draw' declared void
objects.h:55: error: `draw' declared as a `virtual' field
objects.h:65: error: `BITMAP' was not declared in this scope
objects.h:65: error: `img' was not declared in this scope
objects.h:66: error: variable declaration is not allowed here
objects.h:66: error: syntax error before `{' token
objects.h:68: error: `img' was not declared in this scope
objects.h:68: error: ISO C++ forbids declaration of `size_x' with no type
objects.h:68: error: ISO C++ forbids initialization of member `size_x'
objects.h:68: error: making `size_x' static
objects.h:68: error: ISO C++ forbids in-class initialization of non-const
static member `size_x'
objects.h:68: error: declaration of `int sprite::size_x'
objects.h:47: error: conflicts with previous declaration `int sprite::size_x'
objects.h:69: error: `img' was not declared in this scope
objects.h:69: error: ISO C++ forbids declaration of `size_y' with no type
objects.h:69: error: ISO C++ forbids initialization of member `size_y'
objects.h:69: error: making `size_y' static
objects.h:69: error: ISO C++ forbids in-class initialization of non-const
static member `size_y'
objects.h:69: error: declaration of `int sprite::size_y'
objects.h:47: error: conflicts with previous declaration `int sprite::size_y'
objects.h: In member function `virtual bool sprite::animate()':
objects.h:64: error: `FALSE' undeclared (first use this function)
objects.h:64: error: (Each undeclared identifier is reported only once for each
function it appears in.)
objects.h: At global scope:
objects.h:71: error: syntax error before `}' token
objects.h:89: error: `BITMAP' was not declared in this scope
objects.h:89: error: `dest' was not declared in this scope
objects.h:89: error: invalid data member initialization
objects.h:89: error: variable or field `draw' declared void
objects.h:89: error: `draw' declared as a `virtual' field
objects.h:121: error: `BITMAP' was not declared in this scope
objects.h:121: error: `dest' was not declared in this scope
objects.h:121: error: invalid data member initialization
objects.h:121: error: variable or field `draw' declared void
objects.h:121: error: `draw' declared as a `virtual' field
main.cpp:19: error: syntax error before `*' token
main.cpp:20: error: syntax error before `*' token
main.cpp:44: error: syntax error before `*' token
main.cpp:45: error: syntax error before `*' token
main.cpp:46: error: syntax error before `*' token
main.cpp:47: error: syntax error before `*' token
main.cpp:48: error: syntax error before `*' token
main.cpp:49: error: syntax error before `*' token
main.cpp:50: error: syntax error before `*' token
main.cpp:51: error: syntax error before `*' token
main.cpp:106: error: `BITMAP' was not declared in this scope
main.cpp:106: error: `bmp' was not declared in this scope
main.cpp:106: error: invalid data member initialization
main.cpp:107: error: `BITMAP' was not declared in this scope
main.cpp:107: error: `bmp' was not declared in this scope
main.cpp:107: error: invalid data member initialization
main.cpp:107: error: variable or field `show' declared void
main.cpp:110: error: `BITMAP' was not declared in this scope
main.cpp:110: error: `bmp' was not declared in this scope
main.cpp:111: error: `bool CHighScores::add_new' is not a static member of `
class CHighScores'
main.cpp:111: error: syntax error before `{' token
main.cpp:126: error: `bmp' was not declared in this scope
main.cpp:126: error: `font' was not declared in this scope
main.cpp:126: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:126: error: initializer list being treated as compound expression
main.cpp:127: error: `bmp' was not declared in this scope
main.cpp:127: error: `font' was not declared in this scope
main.cpp:127: error: `last_name' was not declared in this scope
main.cpp:127: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:127: error: redefinition of `int textprintf'
main.cpp:126: error: `int textprintf' previously defined here
main.cpp:127: error: initializer list being treated as compound expression
main.cpp:128: error: syntax error before `}' token
main.cpp:141: error: syntax error before `if'
main.cpp:154: error: syntax error before `.' token
main.cpp:155: error: syntax error before `.' token
main.cpp:156: error: syntax error before `.' token
main.cpp:157: error: `vec' was not declared in this scope
main.cpp:157: error: `vec' was not declared in this scope
main.cpp:157: error: ISO C++ forbids declaration of `sort' with no type
main.cpp:157: error: initializer list being treated as compound expression
main.cpp:158: error: syntax error before `.' token
main.cpp:159: error: ISO C++ forbids declaration of `save' with no type
main.cpp:160: error: ISO C++ forbids declaration of `game_plays' with no type
main.cpp:160: error: conflicting types for `int game_plays'
main.cpp:36: error: previous declaration as `bool game_plays'
main.cpp:161: error: ISO C++ forbids declaration of `show_high_score' with no
type
main.cpp:161: error: conflicting types for `int show_high_score'
main.cpp:84: error: previous declaration as `bool show_high_score'
main.cpp:162: error: ISO C++ forbids declaration of `fire_pressed' with no type
main.cpp:162: error: conflicting types for `int fire_pressed'
main.cpp:30: error: previous declaration as `bool fire_pressed'
main.cpp:163: error: syntax error before `return'
main.cpp:174: error: `BITMAP' was not declared in this scope
main.cpp:174: error: `bmp' was not declared in this scope
main.cpp:175: error: variable or field `show' declared void
main.cpp:175: error: `int CHighScores::show' is not a static member of `class
CHighScores'
main.cpp:175: error: syntax error before `{' token
main.cpp:177: error: `bmp' was not declared in this scope
main.cpp:177: error: `font' was not declared in this scope
main.cpp:177: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:177: error: redefinition of `int textprintf'
main.cpp:127: error: `int textprintf' previously defined here
main.cpp:177: error: initializer list being treated as compound expression
main.cpp:178: error: `bmp' was not declared in this scope
main.cpp:178: error: `font' was not declared in this scope
main.cpp:178: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:178: error: redefinition of `int textprintf'
main.cpp:177: error: `int textprintf' previously defined here
main.cpp:178: error: initializer list being treated as compound expression
main.cpp:180: error: syntax error before `for'
main.cpp:180: error: syntax error before `;' token
main.cpp:180: error: syntax error before `++' token
main.cpp:183: error: `bmp' was not declared in this scope
main.cpp:183: error: `font' was not declared in this scope
main.cpp:183: error: `a' was not declared in this scope
main.cpp:183: error: `a' was not declared in this scope
main.cpp:183: error: `with_standard_control' was not declared in this scope
main.cpp:183: error: `a' was not declared in this scope
main.cpp:183: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:183: error: redefinition of `int textprintf'
main.cpp:178: error: `int textprintf' previously defined here
main.cpp:183: error: initializer list being treated as compound expression
main.cpp:185: error: `bmp' was not declared in this scope
main.cpp:185: error: `font' was not declared in this scope
main.cpp:185: error: `a' was not declared in this scope
main.cpp:185: error: `a' was not declared in this scope
main.cpp:185: error: `with_mouse_control' was not declared in this scope
main.cpp:185: error: `a' was not declared in this scope
main.cpp:185: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:185: error: redefinition of `int textprintf'
main.cpp:183: error: `int textprintf' previously defined here
main.cpp:185: error: initializer list being treated as compound expression
main.cpp:186: error: `bmp' was not declared in this scope
main.cpp:186: error: `font' was not declared in this scope
main.cpp:186: error: `a' was not declared in this scope
main.cpp:186: error: `a' was not declared in this scope
main.cpp:186: error: `with_mouse_control' was not declared in this scope
main.cpp:186: error: `a' was not declared in this scope
main.cpp:186: error: ISO C++ forbids declaration of `textprintf' with no type
main.cpp:186: error: redefinition of `int textprintf'
main.cpp:185: error: `int textprintf' previously defined here
main.cpp:186: error: initializer list being treated as compound expression
main.cpp:188: error: syntax error before `}' token
main.cpp: In function `int ShowMenu()':
main.cpp:250: error: `framebuf' undeclared (first use this function)
main.cpp:250: error: `font' undeclared (first use this function)
main.cpp:250: error: `textprintf' cannot be used as a function
main.cpp:252: error: `key' undeclared (first use this function)
main.cpp:252: error: `KEY_ENTER' undeclared (first use this function)
main.cpp:252: error: `joy_b1' undeclared (first use this function)
main.cpp:252: error: `key_shifts' undeclared (first use this function)
main.cpp:252: error: `KB_CTRL_FLAG' undeclared (first use this function)
main.cpp:252: error: `KEY_SPACE' undeclared (first use this function)
main.cpp:252: error: `mouse_b' undeclared (first use this function)
main.cpp:258: error: `KEY_UP' undeclared (first use this function)
main.cpp:258: error: `joy_up' undeclared (first use this function)
main.cpp:271: error: `KEY_DOWN' undeclared (first use this function)
main.cpp:271: error: `joy_down' undeclared (first use this function)
main.cpp:292: error: `textprintf' cannot be used as a function
main.cpp:296: error: `textprintf' cannot be used as a function
main.cpp:298: error: `textprintf' cannot be used as a function
main.cpp:303: error: `textprintf' cannot be used as a function
main.cpp:305: error: `textprintf' cannot be used as a function
main.cpp: In function `void generate_explosion(int)':
main.cpp:325: error: `BITMAP' undeclared (first use this function)
main.cpp:325: error: `temp' undeclared (first use this function)
main.cpp:329: error: `explosion_anim' undeclared (first use this function)
main.cpp:329: error: `create_bitmap' undeclared (first use this function)
main.cpp:330: error: `clear_bitmap' undeclared (first use this function)
main.cpp:351: error: `circle' undeclared (first use this function)
main.cpp:358: error: `circlefill' undeclared (first use this function)
main.cpp:366: error: `getpixel' undeclared (first use this function)
main.cpp:387: error: `putpixel' undeclared (first use this function)
main.cpp:396: error: `blit' undeclared (first use this function)
main.cpp:398: error: `destroy_bitmap' undeclared (first use this function)
main.cpp: In function `void get_frames()':
main.cpp:405: error: `RLE_SPRITE' undeclared (first use this function)
main.cpp:407: error: syntax error before `)' token
main.cpp:408: error: `friendly_missile_frame' undeclared (first use this
function)
main.cpp:408: error: `create_bitmap' undeclared (first use this function)
main.cpp:409: error: `clear_bitmap' undeclared (first use this function)
main.cpp:410: error: `draw_rle_sprite' undeclared (first use this function)
main.cpp:412: error: syntax error before `)' token
main.cpp:413: error: `enemy_missile_frame' undeclared (first use this function)
main.cpp:423: error: `getpixel' undeclared (first use this function)
main.cpp:427: error: syntax error before `)' token
main.cpp:428: error: `satellite_frame' undeclared (first use this function)
main.cpp:432: error: `satellite_immortal_frame' undeclared (first use this
function)
main.cpp:439: error: `putpixel' undeclared (first use this function)
main.cpp:442: error: syntax error before `)' token
main.cpp:443: error: `sight_frame' undeclared (first use this function)
main.cpp:450: error: `ufo_frame' undeclared (first use this function)
main.cpp:454: error: `t' undeclared (first use this function)
main.cpp:457: error: syntax error before `)' token
main.cpp:461: error: `bomb_frame' undeclared (first use this function)
main.cpp:463: error: `itofix' undeclared (first use this function)
main.cpp:463: error: `rotate_sprite' undeclared (first use this function)
main.cpp:479: error: `destroy_bitmap' undeclared (first use this function)
main.cpp:482: error: syntax error before `)' token
main.cpp:483: error: syntax error before `)' token
main.cpp:484: error: syntax error before `)' token
main.cpp:485: error: syntax error before `)' token
main.cpp:486: error: syntax error before `)' token
main.cpp:487: error: syntax error before `)' token
main.cpp:488: error: syntax error before `)' token
main.cpp:489: error: syntax error before `)' token
main.cpp:490: error: syntax error before `)' token
main.cpp:491: error: syntax error before `)' token
main.cpp:492: error: syntax error before `)' token
main.cpp:493: error: syntax error before `)' token
main.cpp:494: error: syntax error before `)' token
main.cpp:495: error: syntax error before `)' token
main.cpp:496: error: syntax error before `)' token
main.cpp:497: error: syntax error before `)' token
main.cpp:498: error: syntax error before `)' token
main.cpp:499: error: syntax error before `)' token
main.cpp:500: error: syntax error before `)' token
main.cpp:501: error: syntax error before `)' token
main.cpp:502: error: syntax error before `)' token
main.cpp:503: error: syntax error before `)' token
main.cpp:504: error: syntax error before `)' token
main.cpp:505: error: syntax error before `)' token
main.cpp: In function `void NewGame()':
main.cpp:518: error: `backdrop' undeclared (first use this function)
main.cpp:518: error: `clear_bitmap' undeclared (first use this function)
main.cpp:526: error: `putpixel' undeclared (first use this function)
main.cpp:531: error: syntax error before `)' token
main.cpp:532: error: syntax error before `)' token
main.cpp:532: error: syntax error before `)' token
main.cpp:532: error: syntax error before `)' token
main.cpp:532: error: `draw_rle_sprite' undeclared (first use this function)
main.cpp:539: error: syntax error before `)' token
main.cpp: In function `bool SetGFXMode()':
main.cpp:584: error: `GFX_AUTODETECT_FULLSCREEN' undeclared (first use this
function)
main.cpp:586: error: `GFX_AUTODETECT_WINDOWED' undeclared (first use this
function)
main.cpp:588: error: `set_gfx_mode' undeclared (first use this function)
main.cpp:590: error: `GFX_TEXT' undeclared (first use this function)
main.cpp:591: error: `allegro_error' undeclared (first use this function)
main.cpp:591: error: `allegro_message' undeclared (first use this function)
main.cpp:595: error: `RGB' undeclared (first use this function)
main.cpp:595: error: syntax error before `)' token
main.cpp: In function `int main(int, char**)':
main.cpp:605: error: `allegro_init' undeclared (first use this function)
main.cpp:606: error: `install_keyboard' undeclared (first use this function)
main.cpp:607: error: `install_mouse' undeclared (first use this function)
main.cpp:608: error: `install_timer' undeclared (first use this function)
main.cpp:609: error: `initialise_joystick' undeclared (first use this function)
main.cpp:612: error: `LOCK_VARIABLE' undeclared (first use this function)
main.cpp:637: error: `data' undeclared (first use this function)
main.cpp:637: error: `load_datafile' undeclared (first use this function)
main.cpp:640: error: `set_gfx_mode' undeclared (first use this function)
main.cpp:641: error: `allegro_message' undeclared (first use this function)
main.cpp:648: error: `DIGI_NONE' undeclared (first use this function)
main.cpp:650: error: `DIGI_AUTODETECT' undeclared (first use this function)
main.cpp:653: error: `MIDI_NONE' undeclared (first use this function)
main.cpp:655: error: `MIDI_AUTODETECT' undeclared (first use this function)
main.cpp:666: error: `install_sound' undeclared (first use this function)
main.cpp:676: error: `set_window_title' undeclared (first use this function)
main.cpp:680: error: `BPS_TO_TIMER' undeclared (first use this function)
main.cpp:680: error: `install_int_ex' undeclared (first use this function)
main.cpp:685: error: `SECS_TO_TIMER' undeclared (first use this function)
main.cpp:687: error: `create_bitmap' undeclared (first use this function)
main.cpp:701: error: `clear' undeclared (first use this function)
main.cpp:706: error: `MIDI' undeclared (first use this function)
main.cpp:706: error: syntax error before `)' token
main.cpp:711: error: `KEY_ESC' undeclared (first use this function)
main.cpp:758: error: `textprintf' cannot be used as a function
main.cpp:763: error: `textprintf' cannot be used as a function
main.cpp:768: error: `stretch_sprite' undeclared (first use this function)
main.cpp:816: error: `acquire_screen' undeclared (first use this function)
main.cpp:817: error: `screen' undeclared (first use this function)
main.cpp:817: error: `blit' undeclared (first use this function)
main.cpp:818: error: `release_screen' undeclared (first use this function)
main.cpp:821: error: `keyboard_needs_poll' undeclared (first use this function)
main.cpp:822: error: `poll_keyboard' undeclared (first use this function)
main.cpp:824: error: `mouse_needs_poll' undeclared (first use this function)
main.cpp:825: error: `poll_mouse' undeclared (first use this function)
main.cpp:827: error: `poll_joystick' undeclared (first use this function)
main.cpp: At global scope:
main.cpp:899: error: ISO C++ forbids declaration of `END_OF_MAIN' with no type
make: *** [main.o] Error 1
The answer is probably simple, but for me, figuring it out is not. Any help?:confused:
|