SFML community forums

Help => General => Topic started by: thatoneguy on June 30, 2013, 08:30:52 am

Title: Issues with linking SFML statically?
Post by: thatoneguy on June 30, 2013, 08:30:52 am
I have SFML linked statically, and I've done some googling on my issue. I believe it has to do with global variables, but if that's the issue how can I avoid it when the variable is a static member of the class? Any way to guarantee that it is initialized after all the linking is done?

Root.hpp
#include <SFML/Graphics.hpp>

class Root {
private:
    static sf::RenderWindow render_window;
};
 

Root.cpp
#include "Root.hpp"

sf::RenderWindow Root::render_window;

int main(int argc, char **argv) {
        //sf::RenderWindow test(sf::VideoMode(200, 200), "TEST");
        return 0;
}
Title: Re: Issues with linking SFML statically?
Post by: Laurent on June 30, 2013, 08:51:05 am
No you can't. So don't do it ;)
Title: Re: Issues with linking SFML statically?
Post by: Mario on June 30, 2013, 11:22:24 pm
You talk about linking statically, then start writing code with the keyword static. You might be messing two things here? Could you elaborate on what exactly you plan to do and where you're stuck?