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

Author Topic: Strange behavior  (Read 2267 times)

0 Members and 1 Guest are viewing this topic.

edwardangle

  • Newbie
  • *
  • Posts: 3
    • View Profile
Strange behavior
« on: August 04, 2014, 04:51:17 pm »
Running Windows 7 64 bit. Using Visual Studio 2010. Using the precompiled for Visual Studio 2010 dlls.

My game launches, occasionally throws the error "the application was unable to start correctly (0xc0000142)", creates a window, draws the graphics to that window (although capped at around 16 FPS), crashes, starts itself again somehow, and then runs perfectly.

Further throwing me off, before it crashes the first time, it refuses to hit breakpoints. I can put a breakpoint in the main function before anything has occurred, or indeed on the function itself, and it makes no difference. Again, after it has crashed, it'll hit the breakpoint on the second go.

More perplexing -- it didn't always do this, and I don't believe I've changed any VS2010 settings. If no one knows why it's doing it now, I'm going to have to go back and check out older versions of the program to try and figure it out -- something I'd like to avoid.

Any ideas?
« Last Edit: August 04, 2014, 05:00:46 pm by edwardangle »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Strange behavior
« Reply #1 on: August 04, 2014, 06:25:49 pm »
Do the precompiled examples run fine? If yes, then there is a bug in your game code, and nobody will be able to help you unless you can reproduce the problem in a complete and minimal code that you can post on the forum.
Laurent Gomila - SFML developer

edwardangle

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Strange behavior
« Reply #2 on: August 04, 2014, 09:50:54 pm »
The example executables work just fine, but when I add the .cpp/hpp files to an empty project, and put the resources where they need to go, build and debug them, they display the same behavior.

They stall at first, perhaps showing the error message, perhaps going non responsive, the window closes, opens again, and runs normally.

Has anyone experienced this? And what should I do?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Strange behavior
« Reply #3 on: August 04, 2014, 10:19:21 pm »
Make sure you don't mix debug and release. Follow the getting started tutorial 1:1 and it should work.
Laurent Gomila - SFML developer

edwardangle

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Strange behavior
« Reply #4 on: August 05, 2014, 03:29:08 am »
I've done this. After I read your advice, I went ahead and did it again, switching over to the static library in the process. It still does the strange behavior, even example code. It's not like my program always did this, either.

Here is the Output.
(click to show/hide)

I don't know what to do. How can it start a program, and run through code without hitting the breakpoints? If I could just figure that much out.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Strange behavior
« Reply #5 on: August 05, 2014, 04:00:44 pm »
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

MahlerFive

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Strange behavior
« Reply #6 on: December 04, 2014, 01:53:48 am »
I ran into the exact same issue and found out that the cause was my antivirus. Disabling my antivirus or adding an exception for my project path fixed the issue.