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

Author Topic: Compiles with no errors, crashes right after.  (Read 6500 times)

0 Members and 1 Guest are viewing this topic.

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Compiles with no errors, crashes right after.
« on: April 01, 2013, 06:30:24 pm »
I have followed every step when it comes to installing SFML for Code Blocks very thoroughly.  Yet anytime I try to run any code I get a crash.  Whats odd is there isn't any compile errors listed.  Instead I get a message that the program, (in this case SFMLtest.exe), has stopped working.  For some reason at this point Visual Studio offers to debug, (even thought I don't have visual studio open).  If I select OK here is what it tells me:

- Unhandled exception at 0x6E201EA1 (sfml-window.dll) in smflTest.exe: 0xC0000005: Access violation writing location 0x00000320.

and

- Unhandled exception at 0x77AB016E (ntdll.dll) in smflTest.exe: 0x00000000: The operation completed successfully.

Below is an example of the type of program I tried to run:

**********************************************************

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow Screen(sf::VideoMode(800,600,32), "Test");
    Screen.Display();
    system("Pause");

    return 0;
}
*********************************************************************

Please not I did make sure all the proper dll's are in the executable folder.

Any ideas anyone?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Compiles with no errors, crashes right after.
« Reply #1 on: April 01, 2013, 07:10:08 pm »
My guess would be that you're using the latest Code::Blocks version, which includes MinGW TDM 4.7.1 and is not compatible with the SFML RC release or in your case SFML 1.6 and thus it crashes. :)

Thus, what version of Code::Blocks, compiler and SFML are you using?

For some reason at this point Visual Studio offers to debug, (even thought I don't have visual studio open).
That's the normal Windows application crash behavior and it suggest Visual Studio, because it's what Windows knows. Unless you're fluent with assembler it won't give you anything though. ;)

Below is an example of the type of program I tried to run:
Please use the code=cpp tag, to post code.

    Screen.Display();
You should be using SFML 2.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #2 on: April 01, 2013, 08:07:49 pm »
Thanks for the suggestion, I will attempt to try an earlier version of Codeblocks and see what happens


eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Compiles with no errors, crashes right after.
« Reply #3 on: April 01, 2013, 08:15:02 pm »
I will attempt to try an earlier version of Codeblocks and see what happens
No! That's not what I suggested! ::)

You shouldn't go back to old stuff, but you should move on and learn new things. Get the newest version of Code::Blocks, download SFML from GitHub and compile it (following the official tutorial), or use my Nightly Builds. :)
« Last Edit: April 02, 2013, 01:15:27 pm by eXpl0it3r »
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #4 on: April 01, 2013, 10:00:36 pm »
Ok sorry,

In my haste and excitement I didn't follow exactly what you said.

So now:

My most recent attempt was with:

- Codeblocks 12.11
- SFML 2.0 (since 1.6 didn't work)

After followin the official SFML tutorial which shows how to link library files etc. a test program is given that draws a green circle in a created window.

I'm getting the same problem once again, no compile errors, but the program crashes stating "testingSFML.exe has stopped working"

Debugger gives : "Unhandled exception at 0x77AB016E (ntdll.dll) in testingSFML.exe: 0x00000000: The operation completed successfully."

I'm wondering if it has something to do with this ntdll.dll file that keeps getting listed.

Have to run off to the ol'job now... but when I get back I will look into Nightly Builds.


XxSpeedDemonxXx

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Compiles with no errors, crashes right after.
« Reply #5 on: April 02, 2013, 11:39:38 am »
Run your program in debug mode under a debugger in order to fix this issue. "ntdll.dll" is not crashing your program.
From sanity, there is insanity.

~Atomic Platypus Studios~

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Compiles with no errors, crashes right after.
« Reply #6 on: April 02, 2013, 01:17:28 pm »
Well the SFML 2 RC is not compatible with MinGW TDM 4.7.1 or gcc 4.7.x for that matter and thus you'll have to recompile (or use my nigthlies). :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #7 on: April 03, 2013, 06:53:21 am »
sigh,

I have to admit a lot of this seems over my head at the moment,

I wish there was just a list somewhere online that worked like this:

download this version of X with this version of Y and this version of Z and it will work....

Thanks for all the help guys I guess I have a lot of reading to do.

XxSpeedDemonxXx

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • Email
Re: Compiles with no errors, crashes right after.
« Reply #8 on: April 03, 2013, 09:46:24 am »
Quote
Thanks for all the help guys I guess I have a lot of reading to do.

Troubleshooting your own problems is a great thing to do; it will make you a better programmer.
From sanity, there is insanity.

~Atomic Platypus Studios~

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Compiles with no errors, crashes right after.
« Reply #9 on: April 03, 2013, 12:04:29 pm »
download this version of X with this version of Y and this version of Z and it will work....
Hmmm... do you mean something like this? ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #10 on: April 03, 2013, 03:00:32 pm »
I spent some time reading about nightly builds.  I'm admittedly an amateur who is pretty much hobby programming.  So this is all pretty new to me.

So at this point here is where I stand:

-Windows 7 64 bit
- CodeBlocks 12.11
- MinGW  (this has been a problem for me, the official release says 'click here to download the latest version' but doesn't say what version you are getting) 

Now when I look at the nightly builds page I'm guessing 'MinGW TDM GCC 4.7.1 64bit' is what I want?

When I unload this it looks to me like the same files that are in the SFML 2.0 directories.  So my question is, are these nightly builds intended to replace the ones in the SFML 2.0 standard installation? Also is it recommended that I use the packaged MinGW/CodeBlock combo? It has been suggested to me that I get them separately.

 If not I'm not really sure where to go from here.... perhaps SFML is beyond my current abilities.
« Last Edit: April 03, 2013, 03:06:37 pm by nicforte »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
AW: Re: Compiles with no errors, crashes right after.
« Reply #11 on: April 03, 2013, 05:49:43 pm »
I spent some time reading about nightly builds.  I'm admittedly an amateur who is pretty much hobby programming.  So this is all pretty new to me.
It seems you have a hard time understanding the principles of libraries in general. It's an important topic you might want to google for a bit. ;)

- MinGW  (this has been a problem for me, the official release says 'click here to download the latest version' but doesn't say what version you are getting)
Does that mean you didn't download Code:'Blocks with MinGW, but got it from MinGW directly?
You can see the version by calling g++ -v on the commandline, given that g++ is found.

Now when I look at the nightly builds page I'm guessing 'MinGW TDM GCC 4.7.1 64bit' is what I want?
If you use the C::B with MinGW, it's the TDM x32 build. If you use MinGW from their website, it's the normal MinGW build (also x32).

When I unload this it looks to me like the same files that are in the SFML 2.0 directories.  So my question is, are these nightly builds intended to replace the ones in the SFML 2.0 standard installation?
Yes, that is the case, but the important difference is, that the bibaries (DLL/LIB/A files) are built with and for the correct compiler.

Also is it recommended that I use the packaged MinGW/CodeBlock combo? It has been suggested to me that I get them separately.
That's personal preferrence. If the current setup works, keep it. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #12 on: April 04, 2013, 06:09:08 am »
Thanks so much I will keep learning and try these things out soon.  You've been very patient and super helpful to this ubern00b

nicforte

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: Compiles with no errors, crashes right after.
« Reply #13 on: April 04, 2013, 07:17:45 am »
Thanks SO MUCH, problem solved! My programs are now running!