SFML community forums

Help => General => Topic started by: edwardangle on August 04, 2014, 04:51:17 pm

Title: Strange behavior
Post by: edwardangle 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?
Title: Re: Strange behavior
Post by: Laurent 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.
Title: Re: Strange behavior
Post by: edwardangle 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?
Title: Re: Strange behavior
Post by: Laurent 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.
Title: Re: Strange behavior
Post by: edwardangle 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.
Title: Re: Strange behavior
Post by: zsbzsb on August 05, 2014, 04:00:44 pm
http://en.sfml-dev.org/forums/index.php?topic=12552.0

Post full output.
Title: Re: Strange behavior
Post by: MahlerFive 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.