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

Author Topic: SFML 2.0 Release binaries?  (Read 1189 times)

0 Members and 1 Guest are viewing this topic.

RevTorA

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML 2.0 Release binaries?
« on: May 09, 2011, 04:14:45 pm »
Hello everyone. Love the library, and I'm actually using it in an RPG engine I'm making, as well as writing tutorials as I go if anyone wants to check 'em out (nothing special, but it's using SFML 2.0 :D): http://www.dreamincode.net/forums/topic/230524-c-tile-engine-from-scratch-part-1/.

I've had no issues with SFML so far. I used CMake to generate Visual C++ 2010 project files, built, and everything went great. But, I want to build a release version of the engine every once in a while to give to a friend or two to check out.

It seems that the SFML lib that I built with cmake only built a debug version of the library. I'm guessing this is because it's still in development and as such release builds haven't been released, so I didn't think much of it. Instead, I figured I could simply use the debug binaries for now in my release build. So I set up VC++ to use them.

The project compiles and links without a problem, but now when I attempt to run it, I'm getting an access violation in one of the SFML library files (I'm not even sure how it knows this when it's a release build but I'll go with it). Here's the error and the associated line from "WindowImplWin32.cpp":

Code: [Select]
Unhandled exception at 0x7647f7cc in RPG.exe: 0xC0000005: Access violation reading location 0x00000001.

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


Looking through the local variables in the debug window, it appears that title is a bad pointer. I've not had this problem ever when running debug builds. Any ideas as to what may be going on?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
SFML 2.0 Release binaries?
« Reply #1 on: May 09, 2011, 04:21:19 pm »
You can't use debug libraries in a release buid, both are incompatible.

To build the release SFML libraries, simply change the CMake variable CMAKE_BUILD_TYPE from Debug to Release (this is explained in the tutorial...).
Laurent Gomila - SFML developer

RevTorA

  • Newbie
  • *
  • Posts: 2
    • View Profile
SFML 2.0 Release binaries?
« Reply #2 on: May 09, 2011, 05:16:16 pm »
Hehe, I didn't think about building the library with "Release" set in VC++  :lol:. I feel like an idiot lol. I thought I had generated all the configs, turns out I had lol.