Hey guys, I'm getting this kinda vague error:

Zeal\src\window.cpp|19|error: cannot declare member function `static unsigned int zeal::window::getWindowCount()' to have static linkage|

With the following code (only what I think is needed, if you need more please do ask)

window.h

namespace zeal {
class window : public element
{
    public:
    static unsigned int getWindowCount();

    private:
    static unsigned int windowCount;
};
}

window.cpp

unsigned int zeal::window::windowCount = 0;

namespace zeal {
    static unsigned int window::getWindowCount(){
        return windowCount;
    }
}

It's only called once from main, I want to call it like this:

main.cpp (one line only)

cout << "Nr of windows: " << window::getWindowCount() << endl;

Any help is much appreciated as usual,
Nick

This question has already been answered. Start a new discussion instead.