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;
  }
7
  • 1
    The application was unable to start correctly That means you don't have the required dlls in any of the folders listed in your windows PATH environment variable or in the same location as your executable. The 0xc000007b code also tells you that if you google it.
    – drescherjm
    Dec 19, 2018 at 15:51
  • Well, what I did was just add all the .dll files (just to be safe) from the folder SFML gave me to the project folder. Could they be in the wrong spot or maybe I am just missing one?
    – Deja
    Dec 19, 2018 at 15:54
  • They need to be in the same place as the executable (which is not the project folder) it should be in the Debug or Release subfolder of the project. Also make sure you don't mix debug and release as these are incompatible with each other.
    – drescherjm
    Dec 19, 2018 at 15:55
  • Okay thank you. I will google the error and see if I can move the files around to the correct spot. I appreciate your help!
    – Deja
    Dec 19, 2018 at 15:55
  • 1
    Thank you all so much... I got it to work. After I put in the .dll to the correct folder I got an error saying "module x64 not compatible with machine x86" so I switched to the 32 bit .dll and it works perfect. Again, I appreciate all your help!
    – Deja
    Dec 19, 2018 at 16:11

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.