0

I'm new to stack overflow... anyway I'm trying to load a bitmap a static bitmap pointer inside of a class "map". The reason why I'm using static is because there's pretty much only going to be one map that I'm testing my game with and I can't think of a good instance name for the class, but I'm getting the unresolved external symbol error. Can someone please tell me what's going on?

#include<allegro5/allegro.h>
#include<allegro5/allegro_image.h>
#include<allegro5/allegro_audio.h>
#include<allegro5/allegro_acodec.h>
#include<fstream>
#include<string>
#include<cmath>
#include<iostream>
using namespace std;

class game
{
public:
    static void initializeSetup()
    {
        al_init();
        al_create_display(800,600);
        al_init_image_addon();
    }
};

class map
{
private:
    static ALLEGRO_BITMAP *tile;
public:
    static void initializeSetup()
    {
        tile = al_load_bitmap("Resources/Ancient_Block_01.bmp");
    }
    static void draw()
    {
        al_draw_scaled_bitmap(tile, 0, 0, 256, 256, 0, 0, 512, 512, 0);
    }
};

int main()
{
    game::initializeSetup();
    map::initializeSetup();
    for(;;)
    {
        al_clear_to_color(al_map_rgb(0,0,0));
        map::draw();
        al_flip_display();
    }
}

You can neglect the stuff related to draw() I think, mainly just the initializeSetup() is causing the problem.

0 Answers0