Importing problems

2013-02-13 Thread Korey Peters
Hi everyone. I'm new to D, coming from a Java/Python background. I've been reading the excellent The D Programming Language book, and want to now start playing around with D. I'm having an issue with importing. When I have the following file: file ~/src/sample.d: =

Re: Importing problems

2013-02-13 Thread H. S. Teoh
On Wed, Feb 13, 2013 at 06:17:51PM +0100, Korey Peters wrote: [...] ...and at the terminal: me@ubuntu:~/src$ rdmd sample.d /tmp/.rdmd-1000/rdmd-sample.d-94E53075E2E84D963426A11F2B81FDED/objs/sample.o: In function `_Dmain': sample.d:(.text._Dmain+0xa): undefined reference to

Re: Importing problems

2013-02-13 Thread Korey Peters
Thanks for your response, H.S.Teoh. On Wednesday, 13 February 2013 at 17:47:09 UTC, H. S. Teoh wrote: You need to specify both files on the command line, so that the linker knows where to find everything: rdmd sample.d sample_a.d Running this from the command line produces

Re: Importing problems

2013-02-13 Thread H. S. Teoh
On Wed, Feb 13, 2013 at 06:57:52PM +0100, Korey Peters wrote: Thanks for your response, H.S.Teoh. On Wednesday, 13 February 2013 at 17:47:09 UTC, H. S. Teoh wrote: You need to specify both files on the command line, so that the linker knows where to find everything: rdmd sample.d

Re: Importing problems

2013-02-13 Thread Korey Peters
Hmm. I moved my two sample files from ~/path/to/where/I/was/working to ~/ and the import worked. This makes me suspect a permissions issue. I'll carry on working in ~/ for now, until I sort my stupidity out! Thanks for your help.

Re: Importing problems

2013-02-13 Thread jerro
On Wednesday, 13 February 2013 at 18:42:51 UTC, H. S. Teoh wrote: On Wed, Feb 13, 2013 at 06:57:52PM +0100, Korey Peters wrote: Thanks for your response, H.S.Teoh. On Wednesday, 13 February 2013 at 17:47:09 UTC, H. S. Teoh wrote: You need to specify both files on the command line, so that

Re: Importing problems

2013-02-13 Thread Korey Peters
On Wednesday, 13 February 2013 at 19:33:00 UTC, jerro wrote: This solves the issue: rdmd --force sample Hi jerro, That definitely helped. There's still some things I haven't figured out yet about D's importing, but this has got me going. Thank you.

Re: Importing problems

2013-02-13 Thread Brad Roberts
On Wed, 13 Feb 2013, jerro wrote: I created self-contained sample.d, ran it with rdmd, then moved class A to sample_a.d and tried to run it with rdmd again. I could reproduce the issue that way. It seems that rdmd caches the dependency list. Using --chatty flag confirms that rdmd does not run

Re: Importing problems

2013-02-13 Thread jerro
Please file a bug report on this. Done.

Re: Importing problems

2013-02-13 Thread H. S. Teoh
On Wed, Feb 13, 2013 at 03:53:51PM -0800, Brad Roberts wrote: On Wed, 13 Feb 2013, jerro wrote: I created self-contained sample.d, ran it with rdmd, then moved class A to sample_a.d and tried to run it with rdmd again. I could reproduce the issue that way. It seems that rdmd caches the