Opening SFML window gives memory read error

后端 未结 2 1274
温柔的废话
温柔的废话 2021-01-28 21:14

I\'m trying to open a SFML window, but every time it is launched it says \"Access violation reading location: 0xCCCCCCC0.\" The error is occuring in the init() method. Relevant

相关标签:
2条回答
  • 2021-01-28 21:36

    Set window to a RenderWindow *window;

    and create it with

    window = new sf::RenderWindow( /*your stuff or default initialize*/ );
    

    and then call

    window->create( /*your settings*/ );
    

    if you didn't already initialize it.

    From then on just access window using '->' instead of '.'

    0 讨论(0)
  • 2021-01-28 21:42

    Fixed it!

    Turns out under the C++ pre-processor I set the definition to SFML_STATIC instead of SFML_DYNAMIC

    0 讨论(0)
提交回复
热议问题