Welcome, Guest. Please login or register.

Author Topic: Loving it but a few questions  (Read 698 times)

0 Members and 1 Guest are viewing this topic.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Loving it but a few questions
« on: January 25, 2015, 04: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

Jebbs

  • Sr. Member
  • ****
  • Posts: 357
  • DSFML Developer
    • View Profile
    • Email
Re: Loving it but a few questions
« Reply #1 on: January 25, 2015, 07: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.
DSFML - SFML for the D Programming Language.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Loving it but a few questions
« Reply #2 on: January 26, 2015, 03:34:33 am »
I'll uh, ignore the issue until my project gets a little further.

Gan

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
Re: Loving it but a few questions
« Reply #3 on: February 20, 2015, 07: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