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 - MattUK

Pages: [1]
1
D / Re: DSFML + Mac OS X
« on: July 20, 2013, 11:18:32 am »
It does, but DMD is actually a front end of the compiler. It uses different back ends for different systems. You actually came up with the answer I was looking for as DMD uses gcc for linkage on OSX.

When using DMD it has its own -L switch in order for it to know what to pass to the linker. So I guess it is actually going to be:
Code: [Select]
dmd main.d system.d audio.d graphics.d window.d network.d -L-L/usr/local/lib/ -L-lcsfml-system -L-lcsfml-audio -L-lcsfml-graphics -L-lcsfml-network -L-lcsfml-window
And if that works it means the idea I had will work perfectly!

Just tried it now, and the compilation was successful!

Matt.

2
D / Re: DSFML + Mac OS X
« on: July 19, 2013, 11:47:40 pm »
-L+, as it turns out is Windows specific(to Optlink), and after looking around I think I got it.

Instead, try:
-L-L/usr/local/lib/

The first -L passes the "-L/usr/local/lib/" to the linker, which should keep /usr/local/lib/ as a path to look for your dylib's. Hopefully that one works. I would be *very* surprised if there was no way to give the linker a search directory.

Quote
I'm currently using Mono-D
I currently use Mono-D too, though I've been considering the idea of writing a new IDE in D using GtkD. :P

I did actually try changing it to -L-L, but the linker still reports that "libcsfml-system.dylib could not be found." Very odd...

And an IDE would be a cool project! I had a look into making a plugin for IntelliJ, but I had no idea where to start, haha.

3
D / Re: DSFML + Mac OS X
« on: July 19, 2013, 10:56:02 pm »
Is it possible to add a search directory to the linker and then use just the names of the dylib's? Something like

Code: [Select]
dmd main.d system.d audio.d graphics.d window.d network.d -L+/usr/local/lib/ -Llibcsfml-system.dylib -Llibcsfml-audio.dylib -Llibcsfml-graphics.dylib -Llibcsfml-network.dylib -Llibcsfml-window.dylib

Purely copy-pasting that results in the linker telling me that no such directory ("+/usr/local/lib") exists. Changing it to "-L/usr/local/lib" has the linker telling me no such file ("libcsfml-system.dylib") exists.

Sadly, I don't think there is a way around having to include all these parameters.

I'm currently using Mono-D, so I've attached a guide (in PDF form) to help those on OS X (mainly), but it could probably be used by those on Linux/Windows, too.

(Can't attach it on the forum, so I've uploaded it to MediaFire: http://www.mediafire.com/view/71feojna1n25fiy/Setting_up_DSFML_with_Mono.pdf)

Regards,
Matt.

4
D / Re: DSFML + Mac OS X
« on: July 19, 2013, 09:20:55 pm »
Thanks for the replies guys! It turns out that you can actually link to .dylibs with D (although the website page on the OS X compiler makes no mention of this ability).

I googled for "dmd dylib" and it turns out that using the compiler switch "-L<path to lib>/libname.dylib" will link the binaries in!

So, to compile a test program with DMD on OS X, you must do the following (assuming you installed CSFML into the directory recommended by the install instructions):

Code: [Select]
dmd main.d system.d audio.d graphics.d window.d network.d -L/usr/local/lib/libcsfml-system.dylib -L/usr/local/lib/libcsfml-audio.dylib -L/usr/local/lib/libcsfml-graphics.dylib -L/usr/local/lib/libcsfml-network.dylib -L/usr/local/lib/libcsfml-window.dylib
It seems you cannot just link in the entire directory, and each *.dylib must be included by name.

I've yet to fully test whether it works or not, but I suspect there are no issues (if it works on Linux, one could presume it should work on OS X).

Edit: Just tested, and yep, works perfectly! Thanks for the bindings, Jebbs :P

5
D / DSFML + Mac OS X
« on: July 18, 2013, 08:47:05 pm »
Hi!

I recently came across Jebbs' DSFML binding, I've been looking for an Object-Oriented wrapper, and Derelict is limited by the fact it uses a C binding (aka no OO).

However, the libraries included are all either .dll or .lib, neither of which are supported by dmd on OS X. Does anyone have a guide on how to build DSFML for OS X, and produce .o or .a files (the library types supported by dmd for Mac).

Thanks,
Matt.

Pages: [1]
anything