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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mgatland

Pages: [1]
1
I worked it out myself.

You can edit the paths inside the dylib files.

To inspect the paths in a dylib file:

> otool -L libsfml-graphics.2.1.dylib

output:
Code: [Select]

libsfml-graphics.2.1.dylib:
@executable_path/../Frameworks/libsfml-graphics.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/libsfml-window.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/libsfml-system.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/freetype.framework/Versions/A/freetype (compatibility version 17.0.0, current version 17.0.0)
...

I removed the "@executable_path/../Frameworks/" part from each of the paths that had it, making them point to the current directory instead.

e.g.
> install_name_tool -change @executable_path/../Frameworks/libsfml-graphics.2.dylib libsfml-graphics.2.dylib libsfml-graphics.2.1.dylib


Each time I used the otool command again to check.

The first path has now changed:

> otool -L libsfml-graphics.2.1.dylib

output:
Code: [Select]

libsfml-graphics.2.1.dylib:
libsfml-graphics.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/libsfml-window.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/libsfml-system.2.dylib (compatibility version 2.0.0, current version 2.1.0)
@executable_path/../Frameworks/freetype.framework/Versions/A/freetype (compatibility version 17.0.0, current ...

Three more to go. Once all of the "@executable..." paths were replaced, and all the expected files were in the current folder, it worked.



Just for reference, to run the program on Windows requires these files:

Code: [Select]
caves3.exe
csfml-audio-2.dll
csfml-graphics-2.dll
csfml-window-2.dll
libsndfile-1.dll
sfmlnet-audio-2.dll
sfmlnet-graphics-2.dll
sfmlnet-window-2.dll

To run the program on OS X, I needed these files:
Code: [Select]
caves3.exe
freetype.framework
libcsfml-audio.2.1.dylib
libcsfml-graphics.2.1.dylib
libcsfml-window.2.1.dylib
libsfml-audio.2.1.dylib
libsfml-audio.2.dylib
libsfml-graphics.2.1.dylib
libsfml-graphics.2.dylib
libsfml-system.2.1.dylib
libsfml-system.2.dylib
libsfml-window.2.1.dylib
libsfml-window.2.dylib
sfmlnet-audio-2.dll
sfmlnet-audio-2.dll.config
sfmlnet-graphics-2.dll
sfmlnet-graphics-2.dll.config
sfmlnet-window-2.dll
sfmlnet-window-2.dll.config
sndfile.framework

(the three *.config files are an alternative to configuring mono in the  /Users/yourname/.mono/config configuration file.)

2
Hi,

I'm trying to get an SFML.Net project from Windows working on a mac (OS X).

I installed Xamarin Studio and Mono.

I downloaded compiled copies of CSFML-2.1-osx-clang-universal and SFML-2.1-osx-clang-universal.

I created caves3.exe from my project.

When I ran it (mono caves3.exe) I got this error:


Code: [Select]
Unhandled Exception: System.DllNotFoundException: csfml-graphics-2
To solve that, I created a file at Users/matthew/.mono/config with this text:

<configuration>
    <dllmap dll="csfml-graphics-2" target="libcsfml-graphics.2.1.dylib" />
    <dllmap dll="csfml-window-2" target="libcsfml-window.2.1.dylib" />
</configuration>
 

And then put libcsfml-graphics.2.1.dylib and libcsfml-window.2.1.dylib in the same folder as caves3.exe

When I run it again mono caves3.exe I get this error:

Code: [Select]
Mono: DllImport unable to load library 'dlopen(libcsfml-graphics.2.1.dylib, 9): Library not loaded: @executable_path/../Frameworks/libsfml-graphics.2.dylib
  Referenced from: /Users/matthew/Documents/projects/caves/caves3/bin/Debug/libcsfml-graphics.2.1.dylib
  Reason: image not found'.

Unhandled Exception:
System.DllNotFoundException: libcsfml-graphics.2.1.dylib

Note that the missing file is libsfml-graphics.2.dylib - the 2.1 file WAS found as I understand.

I have the missing file, libsfml-graphics.2.dylib, from the SFML-2.1-osx-clang-universal.tar.gz download.

But I don't know where to put it.

* Can I override the path "@executable_path/../Frameworks/libsfml-graphics.2.dylib" so I can put the dylib file in the same folder as the .exe file? (that path seems to be hardcoded inside libcsfml-graphics.2.1.dylib)
* Can I put the "missing" libsfml-graphics.2.dylib file somewhere so that mono will find it?

Pages: [1]