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

Author Topic: Release build crashes  (Read 3077 times)

0 Members and 2 Guests are viewing this topic.

Glenn

  • Newbie
  • *
  • Posts: 12
    • View Profile
Release build crashes
« on: September 19, 2011, 06:13:10 am »
So I've just updated to the latest snapshot of SFML 2 and after fixing everything that was broken my app works in debug mode, but not release.

In both cases I am linking to the SFML static builds (-s-d for debug and just -s for release)

When I run in release mode it crashes during initialization.

Here's the call stack:
Code: [Select]

  alphaClient.exe!sf::priv::MutexImpl::Lock()  + 0x7 bytes C++
  alphaClient.exe!sf::Lock::Lock()  + 0x10 bytes C++
  alphaClient.exe!sf::GlResource::GlResource()  + 0x33 bytes C++
  alphaClient.exe!sf::Window::Window()  + 0x32 bytes C++
  alphaClient.exe!sf::RenderWindow::RenderWindow()  + 0x2f bytes C++
alphaClient.exe!App::App()  Line 6 + 0x31 bytes C++
  alphaClient.exe!main(int argc, char * * argv)  Line 15 + 0x26 bytes C++


Here's the exception:
Code: [Select]
Unhandled exception at 0x777c22c2 in alphaClient.exe: 0xC0000005: Access violation writing location 0x00000004.

I have disabled compiler optimization and rebuilt the libs, but I still can't seem to find the issue.

Anybody have any ideas?


EDIT: If I use dynamic libraries it works fine, so it seems to be some issue with the static libraries, which is odd.

Haikarainen

  • Guest
Release build crashes
« Reply #1 on: September 19, 2011, 02:15:15 pm »
Check that you also link -lsfml-main and -lsfml-main-d, also check in wich order you link the libraries.
Also, check that you defined SFML_STATIC.

Glenn

  • Newbie
  • *
  • Posts: 12
    • View Profile
Release build crashes
« Reply #2 on: September 20, 2011, 01:21:46 am »
Here are the libraries I link to and in the order I link them:

Code: [Select]
sfml-graphics-s.lib
sfml-main.lib
sfml-system-s.lib
sfml-window-s.lib


I did define SFML_STATIC

Haikarainen

  • Guest
Release build crashes
« Reply #3 on: September 20, 2011, 09:00:09 am »
Quote from: "Glenn"
Here are the libraries I link to and in the order I link them:

Code: [Select]
sfml-graphics-s.lib
sfml-main.lib
sfml-system-s.lib
sfml-window-s.lib


I did define SFML_STATIC


Its either:
Code: [Select]

sfml-main.lib
sfml-system-s.lib
sfml-window-s.lib
sfml-graphics-s.lib


or:

Code: [Select]

sfml-graphics-s.lib
sfml-window-s.lib
sfml-system-s.lib
sfml-main.lib


Probably the first one, cant remember. You'd find it if you google though.

 

anything