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.
Compiling SFML for Windows
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 this video helps?
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 this video helps?
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!
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!
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement