Thread overview | ||||||||
---|---|---|---|---|---|---|---|---|
|
July 19, 2013 Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
I was just curious if DMD supported linking with .dylib files on OSX. Would one simply do something like this? "dmd main.d somelib.dylib" Thanks! |
July 19, 2013 Re: Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy DeHaan | On Friday, 19 July 2013 at 18:19:20 UTC, Jeremy DeHaan wrote:
> I was just curious if DMD supported linking with .dylib files on OSX.
>
> Would one simply do something like this?
>
> "dmd main.d somelib.dylib"
>
> Thanks!
i don't remember exactly, but if this not work for you try something like this
dmd main.d -L-L/path/to/lib.dylib
i think there was a topic on this on wiki
|
July 19, 2013 Re: Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On Friday, 19 July 2013 at 18:29:12 UTC, evilrat wrote:
> On Friday, 19 July 2013 at 18:19:20 UTC, Jeremy DeHaan wrote:
>> I was just curious if DMD supported linking with .dylib files on OSX.
>>
>> Would one simply do something like this?
>>
>> "dmd main.d somelib.dylib"
>>
>> Thanks!
>
> i don't remember exactly, but if this not work for you try something like this
> dmd main.d -L-L/path/to/lib.dylib
> i think there was a topic on this on wiki
That worked! Just one too many -L's though. It ended up being
dmd main.d -L/path/to/lib.dylib
|
July 19, 2013 Re: Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy DeHaan | On Friday, 19 July 2013 at 19:52:49 UTC, Jeremy DeHaan wrote:
> On Friday, 19 July 2013 at 18:29:12 UTC, evilrat wrote:
>> On Friday, 19 July 2013 at 18:19:20 UTC, Jeremy DeHaan wrote:
>>> I was just curious if DMD supported linking with .dylib files on OSX.
>>>
>>> Would one simply do something like this?
>>>
>>> "dmd main.d somelib.dylib"
>>>
>>> Thanks!
>>
>> i don't remember exactly, but if this not work for you try something like this
>> dmd main.d -L-L/path/to/lib.dylib
>> i think there was a topic on this on wiki
>
> That worked! Just one too many -L's though. It ended up being
>
> dmd main.d -L/path/to/lib.dylib
I have another question.
Is there a way to specify a search directory and then link to each dylib?
I have someone that I'm trying to help by the way, and I don't have a Mac :P
I was pretty sure that -L-L/path/ seemed to be the way to add the search directory, but if I have a dylib named libsomelib.dylib, would I pass -Lsomelib, -Llibsomelib.dylib, -Lsomelib.dylib, or something else?
Thanks for you help.
P.S.
Only a guide for compiling and linking on Windows is in the wiki. That should definitely be changed.
|
July 20, 2013 Re: Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jeremy DeHaan | On Friday, 19 July 2013 at 22:30:42 UTC, Jeremy DeHaan wrote: > On Friday, 19 July 2013 at 19:52:49 UTC, Jeremy DeHaan wrote: >> On Friday, 19 July 2013 at 18:29:12 UTC, evilrat wrote: >>> On Friday, 19 July 2013 at 18:19:20 UTC, Jeremy DeHaan wrote: >>>> I was just curious if DMD supported linking with .dylib files on OSX. >>>> >>>> Would one simply do something like this? >>>> >>>> "dmd main.d somelib.dylib" >>>> >>>> Thanks! >>> >>> i don't remember exactly, but if this not work for you try something like this >>> dmd main.d -L-L/path/to/lib.dylib >>> i think there was a topic on this on wiki >> >> That worked! Just one too many -L's though. It ended up being >> >> dmd main.d -L/path/to/lib.dylib > > I have another question. > > Is there a way to specify a search directory and then link to each dylib? > > I have someone that I'm trying to help by the way, and I don't have a Mac :P > > I was pretty sure that -L-L/path/ seemed to be the way to add the search directory, but if I have a dylib named libsomelib.dylib, would I pass -Lsomelib, -Llibsomelib.dylib, -Lsomelib.dylib, or something else? > > Thanks for you help. > > P.S. > Only a guide for compiling and linking on Windows is in the wiki. That should definitely be changed. with libglfw.dylib it works for me evilrat$ dmd test.d -L-L/Users/evilrat/Documents/prog/glfwbuild/osx/_install/lib -L-lglfw note that first -L is dmd flag to pass linker options, but if you linking just single lib you can simply add it as source file like this "dmd test.d testlib.a" |
July 20, 2013 Re: Linking with .dylibs on OSX? | ||||
---|---|---|---|---|
| ||||
Posted in reply to evilrat | On Saturday, 20 July 2013 at 04:26:45 UTC, evilrat wrote:
>
> with libglfw.dylib it works for me
>
> evilrat$ dmd test.d -L-L/Users/evilrat/Documents/prog/glfwbuild/osx/_install/lib -L-lglfw
>
> note that first -L is dmd flag to pass linker options, but if you linking just single lib you can simply add it as source file like this "dmd test.d testlib.a"
That worked perfectly! Thank you very much!
|
Copyright © 1999-2021 by the D Language Foundation