title: unresolved external symbol "" referenced in function _main
body: <p>I am having trouble regarding three functions called within my main function in my program/game: initEnemy, drawEnemy, and updateEnemy. Each have this error attached to them at runtime: "error LNK2019: unresolved external symbol "..." referenced in function _main"</p>
  
  <p>The function calls are underlined in red in my main function, and when highlighted over say this: "Error: more than one instance of overload function "..." matches the argument list:"</p>
  
  <p>If anyone could help me to understand what the problem is, it would be greatly appreciated. Thank you.</p>
  
  <pre><code>#include &lt;allegro5\allegro.h&gt;
  #include &lt;allegro5\allegro_primitives.h&gt;
  #include &lt;allegro5\allegro_font.h&gt;
  #include &lt;allegro5\allegro_ttf.h&gt;
  #include &lt;allegro5\allegro_image.h&gt;
  #include &lt;iostream&gt;
  #include &lt;stdio.h&gt;
  #include "objects.h"
  #include &lt;cstdlib&gt;
  #include &lt;random&gt;
  using namespace std;
  
  //GLOBALS==============================
  const int WINDOW_WIDTH = 1000;
  const int WINDOW_HEIGHT = 675;
  const int NUM_BULLET = 5;
  const int NUM_ENEMY = 5;
  
  enum STATE{TITLE, PLAYING, LOST};
  enum KEYS{UP, DOWN, LEFT, RIGHT, SPACE, W, A, S, D};
  bool keys[9] = {false, false, false, false, false, false, false, false, false};
  
  int vx = 25;
  int shipvy = 15;
  int runnervy = 15;
  
  int i;
  
  int middleRect_x1 = 0;
  int middleRect_x2 = WINDOW_WIDTH;
  float middleRect_y1 = (WINDOW_HEIGHT / 2) - 40;
  float middleRect_y2 = (WINDOW_HEIGHT / 2) + 40;
  
  float minJumpThing = (WINDOW_HEIGHT - middleRect_y2) / 2;
  
  int playerScore = 0;
  int playerLives = 0;
  
  //function prototypes
  
  void initRunner(Runner &amp;runner);
  void minimumGravRunner(Runner &amp;runner);
  void drawRunner(Runner &amp;runner);
  void runnerJump(Runner &amp;runner);
  void runnerFall(Runner &amp;runner);
  void stopRunner(Runner &amp;runner);
  
  void initShip(Ship &amp;ship);
  void drawShip(Ship &amp;ship);
  void moveShipUp(Ship &amp;ship);
  void moveShipDown(Ship &amp;ship);
  void stopShipBrick(Ship &amp;ship);
  void stopShipWindow(Ship &amp;ship);
  
  void initBullet(Bullet bullet[], int bulletSize);
  void drawBullet(Bullet bullet[], int bulletSize);
  void fireBullet(Bullet bullet[], int bulletSize, Ship &amp;ship);
  void updateBullet(Bullet bullet[], int bulletSize);
  
  void initEnemy(Enemy &amp;enemy, int enemySize);
  void drawEnemy(Enemy &amp;enemy);
  void updateEnemy(Bullet bullet[], int enemySize, Enemy &amp;enemy);
  
  int main(void)
  {
      //primitive variable
      bool done = false;
      bool redraw = true;
  
      float gameTime = 0;
      int frames = 0;
      int gameFPS = 0;
  
      Ship ship;
      Runner runner;
      Bullet bullet[5];
      Enemy enemy;
  
      //object variables
  
      //Allegro variables
      ALLEGRO_DISPLAY *display = NULL;
      ALLEGRO_EVENT_QUEUE *event_queue = NULL;
      ALLEGRO_TIMER *timer = NULL;
      ALLEGRO_FONT *arial = NULL;
      ALLEGRO_FONT *dosapp = NULL;
  
      //Initialization Functions
      if(!al_init())                                      //initialize Allegro
          return -1;
  
      display = al_create_display(WINDOW_WIDTH, WINDOW_HEIGHT);           //create our display object
  
      if(!display)                                        //test display object
          return -1;
  
      al_init_primitives_addon();
      al_install_keyboard();
      al_init_font_addon();
      al_init_ttf_addon();
      al_init_image_addon();
  
      event_queue = al_create_event_queue();
      timer = al_create_timer(1.0 / 60);
  
      arial = al_load_font("arial.ttf", 18, 0);
      dosapp = al_load_font("dosapp.fon", 40, 0);
  
      initBullet(bullet,NUM_BULLET);
      initRunner(runner);
      initShip(ship);
      initEnemy(enemy, NUM_ENEMY);
  
      al_register_event_source(event_queue, al_get_keyboard_event_source());
      al_register_event_source(event_queue, al_get_timer_event_source(timer));
      al_register_event_source(event_queue, al_get_display_event_source(display));
  
      al_start_timer(timer);
      gameTime = al_current_time();
      while(!done)
      {
          ALLEGRO_EVENT ev;
          al_wait_for_event(event_queue, &amp;ev);
  
          if(ev.type == ALLEGRO_EVENT_TIMER)
          {
              if(keys[UP])
              {
                  runnerJump(runner);
              }
              if(runner.y1 &lt;= middleRect_y2 - 10)
              {
                  runnerFall(runner);
                  keys[UP] = false;
              }
              if(!keys[UP])
              {
                  if(runner.y1 &lt; (WINDOW_HEIGHT - 40))
                      runnerFall(runner);
                  else if(runner.y1 &gt;= runner.minimumJump - 40 &amp;&amp; runner.y2 &gt;= runner.minimumJump &amp;&amp;
                      runner.y1 != (WINDOW_HEIGHT - 40) &amp;&amp; runner.y2
                      != WINDOW_HEIGHT)
                  {
                      keys[UP] = true;
                      runnerJump(runner);
                  }
              }
              if(keys[W])
                  moveShipUp(ship);
              if(keys[S])
                  moveShipDown(ship);
              if(ship.y1 &lt;= 0)
                  stopShipWindow(ship);
              else if(ship.y2 &gt;= middleRect_y1)
                  stopShipBrick(ship);
              if(keys[SPACE])
                  drawBullet(bullet,NUM_BULLET);
  
              updateBullet(bullet,NUM_BULLET);
              updateEnemy(bullet,NUM_ENEMY,enemy);
          }
          else if(ev.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
          {
              done = true;
          }
          else if(ev.type == ALLEGRO_EVENT_KEY_DOWN)
          {
              switch(ev.keyboard.keycode)
              {
                  case ALLEGRO_KEY_ESCAPE:
                      done = true;
                      break;
                  case ALLEGRO_KEY_UP:
                      if(runner.y1 == (WINDOW_HEIGHT - 40) &amp;&amp; runner.y2 == WINDOW_HEIGHT)
                          keys[UP] = true;
                      break;
                  case ALLEGRO_KEY_DOWN:
                      keys[DOWN] = true;
                      break;
                  case ALLEGRO_KEY_W:
                      keys[W] = true;
                      break;
                  case ALLEGRO_KEY_S:
                      keys[S] = true;
                      break;
                  case ALLEGRO_KEY_SPACE:
                      if(!bullet[i].live)
                      {
                          keys[SPACE] = true;
                          fireBullet(bullet, NUM_BULLET, ship);
                      }
                      break;
              }
          }
          else if(ev.type == ALLEGRO_EVENT_KEY_UP)
          {
              switch(ev.keyboard.keycode)
              {
                  case ALLEGRO_KEY_ESCAPE:
                      done = true;
                      break;
                  case ALLEGRO_KEY_UP:
                      //if(runner.y1 &lt;= runner.minimumJump - 40 &amp;&amp; runner.y2 &lt;= runner.minimumJump)
                          keys[UP] = false;
                      break;
                  case ALLEGRO_KEY_DOWN:
                      keys[DOWN] = false;
                      break;
                  case ALLEGRO_KEY_W:
                      keys[W] = false;
                      break;
                  case ALLEGRO_KEY_S:
                      keys[S] = false;
                      break;
                  case ALLEGRO_KEY_SPACE:
                      keys[SPACE] = false;
                      break;
              }
          }
          if(redraw &amp;&amp; al_is_event_queue_empty(event_queue))
          {
              al_draw_filled_rectangle(middleRect_x1, middleRect_y1, middleRect_x2, middleRect_y2, al_map_rgb(255,255,255));
              al_draw_textf(arial,al_map_rgb(0,0,0),WINDOW_WIDTH / 2, (WINDOW_HEIGHT / 2) - 20,ALLEGRO_ALIGN_CENTRE,"Score: %d",
                  playerScore);
              al_draw_textf(arial,al_map_rgb(0,0,0),WINDOW_WIDTH / 2, (WINDOW_HEIGHT / 2) + 13,ALLEGRO_ALIGN_CENTRE,"Lives: %d",
                  playerLives);
              drawShip(ship);
              drawRunner(runner);
              drawBullet(bullet,NUM_BULLET);
              if(enemy.live = true)
                  drawEnemy(enemy);
  
              al_flip_display();
              al_clear_to_color(al_map_rgb(0,0,0));
          }
      }
      al_destroy_event_queue(event_queue);
      al_destroy_timer(timer);
      al_destroy_font(arial);
      al_destroy_font(dosapp);
      al_destroy_display(display);                        //destroy our display object
  
      return 0;
  }
  
  void initRunner(Runner &amp;runner)
  {
      runner.ID = RUNNER;
      runner.x1 = 10;
      runner.x2 = runner.x1 + 40;
      runner.y1 = WINDOW_HEIGHT - 40;
      runner.y2 = runner.y1 + 40;
      runner.minimumJump = (middleRect_y2 + minJumpThing) + 45;
  }
  void drawRunner(Runner &amp;runner)
  {
      al_draw_filled_rectangle(runner.x1,runner.y1,runner.x2,runner.y2, al_map_rgb(255,255,255));
  }
  void runnerJump(Runner &amp;runner)
  {
      runner.y1 -= runnervy;
      runner.y2 -= runnervy;
  }
  void runnerFall(Runner &amp;runner)
  {
      runner.y1 += runnervy;
      runner.y2 += runnervy;
  }
  void stopRunner(Runner &amp;runner)
  {
      runner.y1 = (WINDOW_HEIGHT - 40);
      runner.y2 = WINDOW_HEIGHT;
  }
  void initShip(Ship &amp;ship)
  {
      ship.ID = SHIP;
      ship.x1 = 10;
      ship.x2 = ship.x1;
      ship.x3 = ship.x1 + 40;
      ship.y1 = (WINDOW_HEIGHT / 2) / 4 + 50;
      ship.y2 = ship.y1 + 40;
      ship.y3 = ship.y1 + 20;
  }
  void drawShip(Ship &amp;ship)
  {
      al_draw_filled_triangle(ship.x1,ship.y1,ship.x2,ship.y2,ship.x3,ship.y3,al_map_rgb(255,255,255));
  }
  void moveShipUp(Ship &amp;ship)
  {
      ship.y1 -= shipvy;
      ship.y2 -= shipvy;
      ship.y3 -= shipvy;
  }
  void moveShipDown(Ship &amp;ship)
  {
      ship.y1 += shipvy;
      ship.y2 += shipvy;
      ship.y3 += shipvy;
  }
  void stopShipWindow(Ship &amp;ship)
  {
      ship.y1 = 0;
      ship.y2 = 40;
      ship.y3 = 20;
  }
  void stopShipBrick(Ship &amp;ship)
  {
      ship.y1 = middleRect_y1 - 40;
      ship.y2 = middleRect_y1;
      ship.y3 = middleRect_y1 - 20;
  }
  void initBullet(Bullet bullet[], int bulletSize)
  {
      for(int i = 0; i &lt; bulletSize; i++)
      {
          bullet[i].ID = BULLET;
          bullet[i].speed = 20;
          bullet[i].live = false;
          keys[SPACE] = false;
      }
  }
  void drawBullet(Bullet bullet[], int bulletSize)
  {
      for(int i = 0; i &lt; bulletSize; i++)
      {
          if(bullet[i].live)
          {
              al_draw_filled_circle(bullet[i].x,bullet[i].y,2,al_map_rgb(255,255,255));
              keys[SPACE] = false;
          }
      }
  }
  void fireBullet(Bullet bullet[], int bulletSize, Ship &amp;ship)
  {
      for(int i = 0; i &lt; bulletSize; i++)
      {
          if(!bullet[i].live)
          {
              bullet[i].x = ship.x3;
              bullet[i].y = ship.y3;
              bullet[i].live = true;
              keys[SPACE] = false;
              break;
          }
      }
  }
  void updateBullet(Bullet bullet[], int bulletSize)
  {
      for(int i = 0; i &lt; bulletSize; i++)
      {
          if(bullet[i].live)
          {
              bullet[i].x += bullet[i].speed;
              if(bullet[i].x &gt;= WINDOW_WIDTH)
                  bullet[i].live = false;
          }
      }
  }
  void initEnemy(Enemy enemy, int enemySize)
  {
      for(int i = 0; i &lt; enemySize; i++)
      {
          std::default_random_engine y1_generator;
          std::uniform_int_distribution&lt;int&gt; y1_distribution(0,middleRect_y1);
          enemy.ID = ENEMY;
          enemy.live = true;
          enemy.x1 = WINDOW_WIDTH + 50;
          enemy.x2 = enemy.x1 + 40;
          enemy.y1 = y1_distribution(y1_generator);
          enemy.y2 = enemy.y1 + 40;
          enemy.speed = 20;
      }
  }
  void drawEnemy(Enemy enemy)
  {
      al_draw_filled_rectangle(enemy.x1,enemy.y1,enemy.x2,enemy.y2,al_map_rgb(255,0,0));
  }
  void updateEnemy(Bullet bullet[], int enemySize, Enemy enemy)
  {
      for(int i = 0; i &lt; enemySize; i++)
      {
          if(enemy.live)
          {
              std::default_random_engine y1_generator;
              std::uniform_int_distribution&lt;int&gt; y1_distribution(0,middleRect_y1);
              enemy.x1 = WINDOW_WIDTH + 50;
              enemy.x2 = enemy.x1 + 40;
              enemy.y1 = y1_distribution(y1_generator);
              enemy.y2 = enemy.y1 + 40;
              enemy.x1 -= enemy.speed;
              enemy.x2 -= enemy.speed;
              if(bullet[i].x == enemy.x1 &amp;&amp; bullet[i].x == enemy.x2 - 40 &amp;&amp; bullet[i].y &gt;= enemy.y1 &amp;&amp; bullet[i].y &lt;= enemy.y2)
                  enemy.live = false;
          }
      }
  }
  </code></pre>