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

Author Topic: [SOLVED] Can't get minimal example to run VS Community 17, Access Violation  (Read 1689 times)

0 Members and 2 Guests are viewing this topic.

badlukk

  • Newbie
  • *
  • Posts: 4
    • View Profile
After fussing too much with VSCode and trying to compile with MinGW, I decided to try VS Community 2017 today.  So I downloaded it, downloaded the Visual C++ 15 (2017) - 32-bit pre-compiled libs (and extracted to their own folder), and followed these instructions: https://www.sfml-dev.org/tutorials/2.5/start-vc.php

When I tried to build the bare-minimum example in debug mode (I did link the -d libs), it builds successfully and then when I try to run it, I get this:

Code: [Select]
Exception thrown at 0x0F60FA96 (sfml-system-d-2.dll) in sfml-test.exe: 0xC0000005: Access violation reading location 0xCCCCCCD8.

And this exception pops up right next to the first line in main(),
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");

I've googled a lot and find people with other access violations, by not this one from the example code.  If I switch to my release config, it gives me the same error but with different addresses (and says sfml-system-2.dll, omitting the d as I believe it should).

Any help / ideas would be appreciated greatly, as I'm about to give up and move on to another library because I can't get SFML to work for shit on Windows (linux was so much easier, why? why? why?)
« Last Edit: March 01, 2019, 03:11:10 pm by badlukk »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Can't get minimal example to run VS Community 17, Access Violation
« Reply #1 on: February 28, 2019, 11:30:59 pm »
Are you using the x64 setting for your compiler?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

badlukk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Can't get minimal example to run VS Community 17, Access Violation
« Reply #2 on: February 28, 2019, 11:37:29 pm »
No I'm using x86  :-\

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Can't get minimal example to run VS Community 17, Access Violation
« Reply #3 on: March 01, 2019, 07:59:28 am »
Do you have other SFML DLLs in a directory that is in PATH? Copy the DLLs from the 32bits package you downloaded next to your executable.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

badlukk

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Can't get minimal example to run VS Community 17, Access Violation
« Reply #4 on: March 01, 2019, 02:11:50 pm »
OMG thank you, that was exactly the problem!

 

anything