Jump to content
  • Advertisement
Sign in to follow this  
SoulHeart

SFML 1.6 window closes unexpectedly

This topic is 2514 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My code compiles and runs find in code blocks, but when I try to run the exe files from the bin folder the window opens and closes in under a second. Any fixes?Do i have to tell the program to pause? Thanks guys

Share this post


Link to post
Share on other sites
Advertisement
You should try a loop if you are doing SFML. Look at the tutorial for an idea. They use something like while the app is open, run, and on pressing the ESC key or the X for the window, it exits.

As for just seeing the window, a pause could show the window if you call it before you call return.

Share this post


Link to post
Share on other sites
It could be a problem with execution directories and where it is trying to find things, if you are loading from files. When you run in Code::Blocks, the execution directory might not be where the .exe is actually located. Also ensure that the SFML DLLs are where the .exe can find them.

Share this post


Link to post
Share on other sites
Ok I found the problem, but my last question would be is there a way to include the images, fonts, ect. That are needed for the program to run be included in the .exe

Share this post


Link to post
Share on other sites
This might be a little more practicle to use something like PhysicsFS it is a way to use your content that is put into an archive file and easily intergrated with SFML. I made a wrapper class for it but not sure if I still have that I will look if that helps you out. Also it doesn't have to have the conventional .zip you could make your extension be .dat or whatever you want it to be. I hope that helps you with the last question.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!