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

Author Topic: SFML Audio without dlls  (Read 4083 times)

0 Members and 1 Guest are viewing this topic.

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
SFML Audio without dlls
« on: February 02, 2015, 06:13:58 pm »
Is it possible to include the sfml audio module in my project without also having to have openal32.dll and libnsfile.dll in the folder? Could I, for example, compile them into the exe? I've been trying to make a completely portable exe where only one file is necessary for it to run successfully and I'd rather not have to use a different audio library because the sfml one is by far the best and easiest to use that I've found. I'm using SFML 2.1 at the moment because when I tried to upgrade it crashed, but if SFML 2.2 can do it and 2.1 can't then I'll see if I can link to that instead.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML Audio without dlls
« Reply #1 on: February 02, 2015, 07:09:13 pm »
No.
It's something in their licences, I believe, that states that you cannot "hide" them.

SFML currently is undergoing modifications to remove its dependency on one of them, but I think one of them would always need to stay.

I don't know much else about it but thers will be able to give you more details if required although I'm sure there are forum threads (try searching) and issues on SFML's github repo that discuss the details.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML Audio without dlls
« Reply #2 on: February 02, 2015, 08:51:03 pm »
If your own code is licensed under a LGPL-compatible license, you can rebuild SFML with static versions of OpenAL and libsndfile (you'll probably have to build them too), and link that particular version of SFML to your executable.
Laurent Gomila - SFML developer

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: SFML Audio without dlls
« Reply #3 on: February 02, 2015, 10:27:28 pm »
Ah. I have never built a library myself and I must say I wouldn't know where to start. How easy do you reckon it would be to mimic SFML's basic SoundBuffer and Sound classes, just to load and play short sounds from arrays or some other type of container with a library like PortAudio?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: SFML Audio without dlls
« Reply #4 on: February 02, 2015, 11:34:05 pm »
The best solution, by far, is to use those DLLs and stop trying to stuff everything into the executable. Unless you have a very good reason to do so, that I've never heard of before.
Laurent Gomila - SFML developer

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: SFML Audio without dlls
« Reply #5 on: February 03, 2015, 09:20:48 am »
Oh, okay. I ws just trying to replicate something I used to have which was a folder full of loads of exes that did many different things and none of them had any external files, but all of them had both graphics and audio. It just meant that it was really easy to transfer/transport them because there was no chance of losing any important files.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: SFML Audio without dlls
« Reply #6 on: February 03, 2015, 09:30:23 am »
Just add the two DLLs to that directory as well. If you have multiple SFML based executables they'll all be able to use the same DLLs. And to make you feel any better, just think of the DLLs as additional exe files and if you do lose one, you can just download it from the SFML repository again. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: SFML Audio without dlls
« Reply #7 on: February 03, 2015, 05:30:04 pm »
That's a good point because I always separate exes when I'm making them, but once I finish them I could put them all in the same folder and put the dlls in the there. Then again, that would rely on me actually finishing a project rather than just ridiculously over-complicating it until I think of a new idea and make that in a ridiculously over-complicated way.