While using SFML I am getting a memory or out of bounds exception, what is the issue?

0

I am learning how to link SFML so I can use the window tools. My ultimate goal is to write some sort of Chess or Asteroid game just to practice getting better at programming. I used the SFML tutorial to get all of my linking straightened out, and I am doing it dynamically with the .dll files. Everything in this code compiles on Visual Studio 2017, but when the console comes up the error I get is , "The application was unable to start correctly (0xc000007b)."

I am assuming this is some sort of memory error? It took me a while to learn the linking and now I am stuck. Thanks for any help!

PS. This is just suppose to be a simple display a window with a green circle inside of it.

#include "pch.h"
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <time.h>

using namespace sf;

int main()
{
    RenderWindow window(VideoMode(200,200), "My First Window");
    CircleShape shape(100.f);
    shape.setFillColor(Color::Green);

    while (window.isOpen())
    {
      Event event;
    while (window.pollEvent(event))
    {
      if (event.type == Event::Closed)
      {
        window.close();
      }
      window.clear();
      window.draw(shape);
      window.display();
    }
  }
  return EXIT_SUCCESS;
  }
c++
visual-studio
visual-studio-2017
sfml
asked on Stack Overflow Dec 19, 2018 by Deja

1 Answer

0

The answer is already mentioned in the comments, but I will put an actual answer here so it's more visible.

The error code 0xc000007b means that the required .dll files are not in located in PATH or the local directory. To fix this issue, either place your required .dlls in a directory in the system PATH, or in the executable directory.

Also, you need to make sure that you do not mix 32 bit and 64 bit libraries, they are incompatible with each other.

Thank you drescherjm.

answered on Stack Overflow Dec 19, 2018 by Major

User contributions licensed under CC BY-SA 3.0