D packages, include directories, and rdmd

Nick Sabalausky a at a.a
Thu Oct 27 16:16:49 PDT 2011


"Andrew Pennebaker" <andrew.pennebaker at gmail.com> wrote in message 
news:mailman.545.1319755391.24802.digitalmars-d at puremagic.com...
> In addition, I can't even use a naked -I directive without all the
> dmd.conf/DFLAGS stuff.
>
> My module code is in ~/Desktop/src/dashcheck. But even with the -Ipath
> directive, dmd still can't find it.
>
> $ dmd example.d -I~/Desktop/src/dashcheck
> Undefined symbols for architecture i386:
>  "_D9dashcheck12__ModuleInfoZ", referenced from:
>      _D7example12__ModuleInfoZ in example.o
>  "_D9dashcheck9genStringFZAya", referenced from:
>      anon in example.o
>  "_D9dashcheck6genIntFZi", referenced from:
>      anon in example.o
>      _D7example7genEvenFZi in example.o
> ld: symbol(s) not found for architecture i386
> collect2: ld returned 1 exit status
> --- errorlevel 1
>

DMD found it as an import, you're just getting linker errors because you 
didn't tell DMD to actually compile dashcheck.d as well. For better or 
worse, DMD only compiles the files you give it, just like any old C/C++ 
compiler:

dmd example.d ~/Desktop/src/dashcheckdashcheck.d -I~/Desktop/src/dashcheck

RDMD, on the other hand, will actually go ahead and compile all the 
necessary .d files:

rdmd --buildonly -I~/Desktop/src/dashcheck example.d

(Note that RDMD requires the .d file to be the last parameter. Run rdmd with 
no args for more details.)

There's one more thing though: I noticed from your OP that you're using DMD 
2.051. The RDMD included in that is riddled with fairly major bugs that have 
all since been fixed. You're going to have a hard time getting that old RDMD 
to work right. So you should grab the rdmd binary from the latest release 
(2.056): http://ftp.digitalmars.com/dmd.2.056.zip

You can just replace your existing rdmd binary with the one in there. It 
should still work with DMD 2.051. Of course, DMD 2.051 itself is getting a 
bit old too, so you may want to think about just simply upgrading to 2.056.





More information about the Digitalmars-d mailing list