SFML community forums

Help => Graphics => Topic started by: diegonolan on August 28, 2012, 08:51:57 pm

Title: Access Violation in when creating sf::Window
Post by: diegonolan 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]
Title: Re: Access Violation in when creating sf::Window
Post by: Laurent 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.
Title: Re: Access Violation in when creating sf::Window
Post by: diegonolan 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.
Title: Re: Access Violation in when creating sf::Window
Post by: diegonolan 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.