GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: Add Line Numbers


linkage'd by godecho
// linkage error:
// main.obj : error LNK2001: unresolved external symbol "protected: static class Blert * Blert::_instance" (?_instance@Blert@@1PAV1@A)

#include <iostream>
#include <map>

using::std::cout;
using::std::endl;
using::std::map;

class Blert
{
    public:
        
        static inline Blert *Inst()
        {    
            return _instance;
        }

    protected:

        Blert()
        {
            _instance = new Blert;
        }

        ~Blert()
        {
            delete _instance;
        }

        static Blert *_instance;

    private:

        // nothing
};

int main(int argc, char **argv)
{
    cout << Blert::Inst() << endl;

    return 0;
}