• Advertisement
Sign in to follow this  

Compiling SFML for Windows

This topic is 2106 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

I finished making my first attempt at a game. I did it using SFML2 in Xcode on my mac. I have been able to figure out how to create the application bundle for distribution. What I would like to know is it it possible to compile the program to run on windows as well? In my code I didn't use anything other than c++ classes, SFML classes and my own classes (No OSX APIs). I can't think of anything that would need to change between the platforms other than the SFML stuff. I know that on windows you need dlls and stuff rather than frameworks.

Is it possible for me to compile my application so that my friend can run it on his windows pc? I have access to bootcamp running windows 7 if needed. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Sure. SFML is programmed in Windows first and foremost, and ported to Mac secondarily. Use MinGW and compile it on your Windows 7 install.
I haven't compiled SFML from source personally, though I have compiled other libraries from source. I use the pre-compiled windows distribution of SFML 1.6 for my own project.

Maybe [url="http://www.youtube.com/watch?v=U1zN_QRSwxw"]this video[/url] helps?

Share this post


Link to post
Share on other sites
Awesome! Using Code::Blocks MinGW and the video you provided there I was finally able to get SFML2 to run on Windows. I tried before with Visual Studio but it just wasn't working for me. Now my question is how do I distribute the application so that the images are in a place that the program will always find them? In the OSX application bundle they are put in the bundle automatically and sent with the app. The exe that is produced doesn't have them I believe. Do i need to just zip the whole file app/ directory up the exe the dlls and the images together, then just tell him to run it from that folder?

Edit: I just copied the application from the bin/release folder into a new folder with the dlls and the images and the application runs fine. I will just zip up this folder and send it off. Its not pretty but it works without having to make any sort of installer. Thanks for your help!

Share this post


Link to post
Share on other sites
Glad to help.

Yea, just having it all in a single zip folder is common in Windows for smaller programs (for small programs, I actually prefer it that way). If you make a larger program or want to release it commercially, then an installer is recommended to seem more professional and to simplify things for the end-user.

Share this post


Link to post
Share on other sites
As long as all your references are in relation to your .exe's directory, you'll be fine. Just make sure the images and .dlls get included in the zip. I think there is a way to include everything in one .exe but I haven't investigated it yet.

Share this post


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

  • Advertisement