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

Author Topic: Do I have to "Set up" SFML everytime I want to open a new project?  (Read 3802 times)

0 Members and 1 Guest are viewing this topic.

DiegoWashed

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
At least for me, it took me weeks before I could get it working, I did the instalation process in so many ways and
so many times that now I am really confused about what I did to get it right, but it works! Im more in like
" dont touch it or it will get broken" state of mind, almost teared up when the big green circle compiled correctly
As I said I dont want to mess with the first succesful sfml set up, so I wanted to do another one, but
do I have to do the whole process again? it seems  that I need to link my files again, is there an option to just
copy what I did to another project?
I am using the newest Code blocks version and SFML 2.1 if that matters;
I know it is a small question but it would truly help me the long way!
Thanks!

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Do I have to "Set up" SFML everytime I want to open a new project?
« Reply #1 on: October 10, 2013, 10:06:58 pm »
Either use the template I made a while back (no guarantee that it works): http://en.sfml-dev.org/forums/index.php?topic=10976.0

Or just spend 1 minute setting up your own project:
1. Create a new console application (yes console application, if you can't do this I can't help you), you can get rid of the console later if you want.
2. Open up the Project > Build Options.
You will have to do this per target (Debug, Release, etc.):
3. If and only if you want to link to the static version of SFML libraries, add SFML_STATIC to the empty page in the Compiler Settings > #defines tab.
4. In Linker Settings, add the libraries you need depending on what you use in your code. If you are using static libraries, add -s after the library name. If you are using debug libraries add -d after everything else (static debug would mean -s-d after the name). Beware of ordering.
5. Write your code.

If you didn't set up your search directories yet, do so:
1. Open up Settings > Compiler.
2. In the Search Directories > Compiler tab add the full path to the sfml2/include folder.
3. In the Search Directories > Linker tab add the full path to the sfml2/lib folder.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Josh_M

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Do I have to "Set up" SFML everytime I want to open a new project?
« Reply #2 on: October 11, 2013, 03:05:37 am »
You can save your current project as a template, which means you just select whatever you saved that template as for future projects. However it will have all your old files in it, so you might want to save a template with no files in it for simplicity. :)

Clockwork

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: Do I have to "Set up" SFML everytime I want to open a new project?
« Reply #3 on: October 11, 2013, 06:48:39 am »
Yeah, like Josh_M said, if you are using Visual Studio (2012 at least, not sure about earlier), than you can just save one of your projects as a template project. It's under File > Export Template.

That's what I use and it works like a charm.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: Do I have to "Set up" SFML everytime I want to open a new project?
« Reply #4 on: October 11, 2013, 07:36:25 am »
Or you do the complete setup again and again, so that you eventually understand it. Once understood, it takes 30 seconds (add include path, add lib path, add libs). Much less than the time you'll spend writing the application itself.
Laurent Gomila - SFML developer

DiegoWashed

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: Do I have to "Set up" SFML everytime I want to open a new project?
« Reply #5 on: October 11, 2013, 04:35:18 pm »
Thanks a lot everyone for the quick answers!
I tried using the template and it works very well, thats what I was looking for, but I guess I do need to learn the "proper" way of setting
it up, anyway thanks again! ;D