Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Issues with linking SFML statically?  (Read 1079 times)

0 Members and 1 Guest are viewing this topic.

thatoneguy

  • Newbie
  • *
  • Posts: 25
    • View Profile
Issues with linking SFML statically?
« 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;
}

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Issues with linking SFML statically?
« Reply #1 on: June 30, 2013, 08:51:05 am »
No you can't. So don't do it ;)
Laurent Gomila - SFML developer

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: Issues with linking SFML statically?
« Reply #2 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?