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

Author Topic: How to package libraries in a way that lets others run my executable?  (Read 8556 times)

0 Members and 1 Guest are viewing this topic.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
I can run the executable on my machine but my friends can't run it on theirs.

How can I package it all together so the libraries are in/with the executable?


(I'm using SFML with the DSFML bindings in D language)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #1 on: February 08, 2015, 01:03:58 am »
Ship all the libraries (DLL) with your application.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #2 on: February 08, 2015, 02:15:43 am »
Oh. Forgot to mention. My friends and I use Macs.
The program outputs a message on their machine that it can't find the libraries in some obscure place.

Edit:
dyld: Library not loaded: @executable_path/../Frameworks/libdsfml-graphics.2.dylib

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #3 on: February 08, 2015, 10:02:59 am »
Yes, so do what eXpl0it3r said and shipp the libraries. The most userfriendly aproach would probably be to generate a app bundle or installer.
Take a look here: https://developer.apple.com/library/mac/documentation/Porting/Conceptual/PortingUnix/distributing/distibuting.html

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #4 on: February 08, 2015, 11:18:29 am »
I'd rather not make an installer, but I wouldn't mind making an Application Bundle.

I'll try to figure out how to make a bundle.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #5 on: February 10, 2015, 05:17:31 pm »
Take a look at the tutorial...
SFML / OS X developer

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #6 on: February 10, 2015, 10:57:10 pm »
Which one?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #8 on: February 11, 2015, 07:52:05 am »
@Hiura

The tutorial does not explain how to bundle the mac libraries so the SFML application written in D can use them.
Rather, it doesn't explain how to bundle the mac libraries with the executable for outside users to use at all.

@eXpl0it3r

The official tutorial doesn't work:
Quote
clang: error: unknown argument: '-frameworksfml-system'
clang: error: unknown argument: '-frameworksfml-window'
clang: error: unknown argument: '-frameworksfml-graphics'
clang: error: unknown argument: '-frameworksfml-audio'
clang: error: unknown argument: '-frameworksfml-network'


If you guys can prove me wrong by solving my problem, I will gladly eat my words. But at the moment the absolute worst thing(to me) about SFML is how difficult it is to let other people try out your executable.
« Last Edit: February 11, 2015, 07:53:41 am by Gan »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #9 on: February 11, 2015, 08:35:25 am »
Quote
But at the moment the absolute worst thing(to me) about SFML is how difficult it is to let other people try out your executable.
How different is it from other libraries in this regard? If you know how to distribute your package with library XYZ then you know how to do it with SFML as well. Or is there something different with SFML?
Laurent Gomila - SFML developer

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #10 on: February 11, 2015, 08:57:40 am »
There is a link to the «Bundle Programming Guide», follow it.
SFML / OS X developer

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #11 on: February 20, 2015, 03:39:50 am »
There is a link to the «Bundle Programming Guide», follow it.
Please don't respond unless you can be helpful.


So I managed to make a bundle that can be shared(ran on other computers). I created a Folder, gave it a .app extension, copied a Info.plist from another app(edited the plist for my application), added the Resources, MacOS and Frameworks folder, copied the SFML frameworks to the Frameworks folder and boom it now works.

The only problem is now I can't get it to load a font that I place in the Resources folder.

Compiling with DUB produces an Executable file, I managed to hand-make a Application bundle for the Executable file.
To clarify my question:
How do I make my hand crafted Application Bundle load a font from the Resources folder?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #12 on: February 20, 2015, 08:04:09 am »
There is a link to the «Bundle Programming Guide», follow it.
Please don't respond unless you can be helpful.
How is pointing out that there is a link to the documentation you need not being helpful???

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: How to package libraries in a way that lets others run my executable?
« Reply #13 on: February 20, 2015, 09:03:36 am »
There is a link to the «Bundle Programming Guide», follow it.
Please don't respond unless you can be helpful.
How is pointing out that there is a link to the documentation you need not being helpful???

Quote
Creating an Application Bundle
The simplest way to create an application bundle is using Xcode. All new application projects include an appropriately configured application target, which defines the rules needed to build an application bundle, including which source files to compile, which resource files to copy to the bundle, and so on. New projects also include a preconfigured Info.plist file and typically several other files to help you get started quickly. You can add any custom files as needed using the project window and configure those files using the Info or Inspector windows. For example, you might use the Info window to specify custom locations for resource files inside your bundle.

For information on how to configure targets in Xcode, see Xcode Build System Guide.

If you're refering to this section of that document, that is as useful as a colander being used to hold tomato soup.
I will look to see if I can take a pre-existing executable and build an Application Bundle through XCode but I don't think that Xcode was designed for that.
In this circumstance, I'm looking for instructions to convert an already compiled executable(from D Language using DUB) into an Application Bundle. I'm not taking just a C or C++ source code and compiling it. If I were, XCode would be my choice. However XCode is not a part of my workflow.

Please take an effort to diagnose the problem before pasting a solution that does not apply.


Sorry for my crankiness, I really do appreciate your attempts to help.
« Last Edit: February 20, 2015, 09:24:03 am by Gan »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How to package libraries in a way that lets others run my executable?
« Reply #14 on: February 20, 2015, 09:13:36 am »
Quote
Please take an effort to diagnose the problem before pasting a solution that does not apply.
Don't forget that you're on the SFML forum. It's already great that people try to help you with this totally unrelated problem, but don't expect too much from us. Maybe you should try to find a more suitable forum in case nobody can help you here.
Laurent Gomila - SFML developer

 

anything