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

Author Topic: Access Violation in when creating sf::Window  (Read 2178 times)

0 Members and 1 Guest are viewing this topic.

diegonolan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Access Violation in when creating sf::Window
« on: August 28, 2012, 08:51:57 pm »
I am using VS2010 with sfml 2.0 rc and I am getting an access violation when creating a window.  I was able to make other sfml programs work fine, but my project file seems to be messing this one up.  This is the line of code the program fails at in WindowImplWin32.cpp.

 int count = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, title.c_str(), static_cast<int>(title.size()), wTitle, sizeof(wTitle) / sizeof(*wTitle));
 

I thought it was a unicode problem so I changed Project->Properties->General->Character Set to Use Multi-Byte Character Set but that didn't work.

I don't want to make a project from stract because I am using IBM cplex and all the settings are working for it but seem to conflict with sfml settings.  I attached my project file.



[attachment deleted by admin]

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Access Violation in when creating sf::Window
« Reply #1 on: August 28, 2012, 08:56:02 pm »
Have you compiled SFML? There's no precompiled release for 64-bits VC++, and you can't use the 32-bits ones.
Laurent Gomila - SFML developer

diegonolan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Access Violation in when creating sf::Window
« Reply #2 on: August 28, 2012, 09:02:36 pm »
Yeah, I compiled my own 64 bit binaries and got it working with another program that was only using sfml.

This IBM ILOG Cplex requires some funky settings so I got it working before adding the sfml part.  Which seems to be messing it up.  I need 64 bit because the optimization part requires more than 4 GB of memory.

diegonolan

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Access Violation in when creating sf::Window
« Reply #3 on: August 28, 2012, 10:59:23 pm »
Fixed it.  It was because the default setttings for the library were Mta while my binaries were compiled for MDd.  Turns out cplex has binaries for all 4 code generation settings and I just had to change what lib files i was linking.

 

anything