Re: Linking from source-code

2013-11-15 Thread Jacob Carlborg
On 2013-11-14 14:49, Andrea Fontana wrote: BTW: you say "used like header files". You mean files that are not "compiled" but "imported"? Yes. When you have a pre-compiled library and need to declarations. -- /Jacob Carlborg

Re: Linking from source-code

2013-11-14 Thread Adam D. Ruppe
On Thursday, 14 November 2013 at 13:49:02 UTC, Andrea Fontana wrote: I think it's a better idea to make it works from dmd/rdmd. pragma(lib) works almost everywhere with dmd* except phobos, due to how that is compiled. rdmd ignores modules in the std namespace when building the dependenc

Re: Linking from source-code

2013-11-14 Thread Andrea Fontana
On Thursday, 14 November 2013 at 12:35:16 UTC, Jacob Carlborg wrote: On 2013-11-14 13:12, Andrea Fontana wrote: So I though this function didn't exist. Why doesn't it work? I doesn't work when D modules are used like header files. See: https://d.puremagic.com/issues/show_bug.cgi?id=2776 An

Re: Linking from source-code

2013-11-14 Thread Jacob Carlborg
On 2013-11-14 13:12, Andrea Fontana wrote: So I though this function didn't exist. Why doesn't it work? I doesn't work when D modules are used like header files. See: https://d.puremagic.com/issues/show_bug.cgi?id=2776 Another idea would be to use dub: http://code.dlang.org/ -- /Jacob Car

Re: Linking from source-code

2013-11-14 Thread Jacob Carlborg
On 2013-11-14 12:46, Ali Çehreli wrote: I have never used it but there is pragma(lib): http://dlang.org/pragma.html Unfortunately that doesn't work with .di files. Although it might work for Deimos projects. -- /Jacob Carlborg

Re: Linking from source-code

2013-11-14 Thread Andrea Fontana
On Thursday, 14 November 2013 at 11:46:19 UTC, Ali Çehreli wrote: On 11/14/2013 03:43 AM, Andrea Fontana wrote: Is there a way to define a library to link inside d source? I can't find anything about it. I have never used it but there is pragma(lib): http://dlang.org/pragma.html Ali Hmm

Re: Linking from source-code

2013-11-14 Thread Ali Çehreli
On 11/14/2013 03:43 AM, Andrea Fontana wrote: Is there a way to define a library to link inside d source? I can't find anything about it. I have never used it but there is pragma(lib): http://dlang.org/pragma.html Ali

Linking from source-code

2013-11-14 Thread Andrea Fontana
Is there a way to define a library to link inside d source? I can't find anything about it. IMHO it would very useful for deimos libraries or curl. So when you import a library, it has embedded the linking instruction. For import we write: import std.stdio; That means "more or less": look f