SFML community forums

Bindings - other languages => D => Topic started by: Gan on January 25, 2015, 05:10:20 am

Title: Loving it but a few questions
Post by: Gan on January 25, 2015, 05:10:20 am
I'm using D-SFML on a Mac using Xamarin Studio and when I send my executable to another person, they can't run it. They get this error:

Quote
[1/24/15, 8:42:41 PM] Connors: terminal
[1/24/15, 8:42:43 PM] Connors: Last login: Sat Jan 24 19:41:59 on ttys001
/Users/Connor/Downloads/spacecraft ; exit;
Connors-MacBook:~ Connor$ /Users/Connor/Downloads/spacecraft ; exit;
dyld: Library not loaded: @executable_path/../Frameworks/libdsfml-graphics.2.dylib
  Referenced from: /Users/Connor/Downloads/spacecraft
  Reason: image not found
Trace/BPT trap: 5
logout

[Process completed]

How can I include the libraries with the binary?


Thanks,
Gan
Title: Re: Loving it but a few questions
Post by: Jebbs on January 25, 2015, 08:10:06 am
I haven't built/ran anything on a Mac in quite  some time, but I can tell you this isn't just a D issue. You'll need to either make sure the libraries or frameworks get installed to the correct path in your friend's computer or include them directly with your executable and have them load when you run it. It should be the exact  same process as it would be with the C++ version. If you do a search for that I'm sure you'll find the right information. I only have one Mac machine so I haven't had to try getting a build to work on other Macs.
Title: Re: Loving it but a few questions
Post by: Gan on January 26, 2015, 04:34:33 am
I'll uh, ignore the issue until my project gets a little further.
Title: Re: Loving it but a few questions
Post by: Gan on February 20, 2015, 08:55:30 pm
To fix this issue, make your own Application Bundle and put the required frameworks in it.

For loading resources in the bundle:
Code: [Select]
string path = thisExePath();
int index = to!int(path.lastIndexOf("/"));
if (!GameFont.loadFromFile(path[0 .. index]~"/vertiup2.ttf")) {
writeln("Font failed to load");
}


Bundle for editing: http://cl.ly/121f0j0d273S (http://cl.ly/121f0j0d273S)