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

Author Topic: Exporting a final project  (Read 3450 times)

0 Members and 1 Guest are viewing this topic.

aradarbel10

  • Newbie
  • *
  • Posts: 6
    • View Profile
Exporting a final project
« on: April 29, 2018, 10:02:50 pm »
Hello, I know that my question wes asked too many times before, but I still need help with this.
As I mentioned in the title, my question is how do I export/build my c++ project with SFML to get an .exe file?
I heard that I have to include SFML statically, but I don't know how to do it. Also, I have extra files for the textures, so I will probably need a date folder. I want the program to be runnable on any computer.
Can you explain the full steps? That's my first time doing something like that so I don't know almost nothing.
Also links to external sources will be helpful too.

Thanks for ANY help,
Arad.

Antonio9227

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Exporting a final project
« Reply #1 on: May 04, 2018, 02:39:12 am »
Probably the first step is to organize your resources in folders (eg: Data\Graphics\mySprite.png, Data\Sounds\pop.wa, etc). This is probably the easiest and straight forward way of managing your resource files.

Here are step by step instructions on how to link to the static version of SFML:
Instructions for CodeBlocks
Instructions for VisualStudio

The short answer is you have to pre-define "SFML_STATIC" and add the "-s" suffix to your linked libraries ("sfml-graphics" will become "sfml-graphics-s"), but you can just follow the instructions in the links above.

If you use the audio module from SFML you will still have to copy "openal32.dll" (which you can find in your SFML folder\bin) in the same folder as your exe file.

That's pretty much it. Your final folder should contain the exe file, openal32.dll if you use sound and your resource folders. It should run perfectly on other PCs too.

 

anything