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

Author Topic: SFML Game Development Book Chapter 3. Problems when running the code! Any help?  (Read 1252 times)

0 Members and 1 Guest are viewing this topic.

gw

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hello everyone,

I am following along with the SFML Game Development book, everything was going fine until I hit chapter 3.
I finished the chapter, wrote all the code for the chapter, it compiles with no problems but when I run it I get the following error:

Unhandled exception at 0x0FDA271C (sfml-graphics-d-2.dll) in CH3 TEST.exe: 0xC0000005: Access violation reading location 0x43A00004.

In the 'locals' window in visual studio, variables like mSprite have the following message:

   mSprite   <Information not available, no symbols loaded for sfml-graphics-d-2.dll>   

I have included a screenshot so you can get an idea: http://imgur.com/pemX3rY

Some more information:

I compiled SFML myself to use it with Visual Studio 2013. It was working perfectly and I was able to run the code from chapters 1 and 2 with no problems.

I downloaded the latest code for the book I could find on github, after building them the .exe run fine.
I created a new project and used the code from the Github page.
As before, it compiles with no problems but when I run it the same error comes up (detailed in the screenshot above).

Any ideas of what might be going on?
Please help and thank you for your time

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Sounds like your sprite or entity is not initialized correctly.

Can you provide the source code?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

gw

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hey,

I fixed it.

I got the pre-compiled binaries from this thread : http://en.sfml-dev.org/forums/index.php?topic=13549.0

And linked my solution to those. Ran it again without changing any code whatsoever, and now it runs fine.

I'm not sure if I did not build SFML correctly the first time, but as the code form earlier chapters was running fine I assumed it was built and linked correctly.

Anyway, my mistake. Sorry to waste your time.

And thanks for the reply.

 

anything