Installing Modules
TJB
broughtj at gmail.com
Wed Mar 28 20:02:26 PDT 2012
On Thursday, 29 March 2012 at 02:07:24 UTC, Jesse Phillips wrote:
> On Wednesday, 28 March 2012 at 23:55:38 UTC, TJB wrote:
>> All,
>>
>> I'm very new to D. I am wanting to install the SciD module
>> (David Simcha's fork), but I don't know how to go about it.
>> Can you guide me?
>>
>> Where does the code go? How do I import it?
>>
>> Thanks,
>>
>> TJB
>
> There are many ways to go about using modules, I will go over
> installing a module for Linux. Usually the simplest way to get
> started is to pass all files to the compiler (you use an import
> statement to import the modules).
>
> Build SciD as a library.
>
> $ dmd -lib -oflibscid.a all.d files.d for.d SciD.d
>
> Copy lib to /usr/local/lib
>
> Copy sciD source files in the same direcectory structure
> (propably starting with scid/) to /usr/local/src
>
> Installed.
>
> Create a main.d file somewhere:
>
> $ cat main.d
> import scid.something;
> void main() {}
>
> $ dmd -I/usr/local/src main.d
>
> Windows would be something different, however optlink doesn't
> have a standard set of locations to look for library files. you
> can also pass the library to dmd
>
> $ dmd -I/usr/local/src main.d libscid.a -- If it is in the same
> directory as main.d
Okay. I tried this. I think I am close. I followed the
instructions that you gave (thanks btw)!
But, I get this error message:
$ dmd -I/usr/local/src main.d
main.d(1): Error: module scid is in file 'scid.d' which cannot be
read
import path[0] = /usr/local/src
import path[1] = /Users/name/dmd2/src/phobos
import path[2] = /Users/name/dmd2/src/druntime/import
Thoughts?
Thanks!
TJB
More information about the Digitalmars-d-learn
mailing list