www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - New to D, path errors under WinXP

reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
First, is there any way other than Web-News to search the D forum archives? Or
any way of making an inclusive search with Web-News?

Anyway, I'm trying to compile some examples under D for Windows, under Windows
XP SP2. I've placed the files in the proper places in C:\DM, C:\DMD and
C:\D\LIB and C:\D\IMPORT. (I know DOS well) I've also set up the path to the
C:\DM\BIN and C:\DMD\BIN dirs.

Somehow the D compiler can't find the Import modules no matter what, unless I
copy them all to the same folder.

Does D work for Windows or is it an untested source release?

Is there any way of explicitly specifying the path of a module in the .D file?
Sep 10 2007
next sibling parent reply Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 First, is there any way other than Web-News to search the D forum
 archives? Or any way of making an inclusive search with Web-News?
I just use the archive links on the http://digitalmars.com/D page, or google i.e. google for "site:digitalmars.com/D <thing I want>"
 Anyway, I'm trying to compile some examples under D for Windows,
 under Windows XP SP2. I've placed the files in the proper places in
 C:\DM, C:\DMD and C:\D\LIB and C:\D\IMPORT. (I know DOS well) I've
 also set up the path to the C:\DM\BIN and C:\DMD\BIN dirs.
 
 Somehow the D compiler can't find the Import modules no matter what,
 unless I copy them all to the same folder.
 
 Does D work for Windows or is it an untested source release?
It works. :) Edit C:\DMD\BIN\SC.INI, eg. [Version] version=7.51 Build 020 [Environment] LIB="% P%\..\lib";% P%\..\..\dm\lib DFLAGS="-I% P%\..\src\phobos" LINKCMD=% P%\..\..\dm\bin\link.exe Add your import and lib paths, eg. [Version] version=7.51 Build 020 [Environment] LIB="% P%\..\lib";% P%\..\..\dm\lib;% P%\..\..\D\LIB DFLAGS="-I% P%\..\src\phobos;% P%\..\..\D\IMPORT" LINKCMD=% P%\..\..\dm\bin\link.exe
 Is there any way of explicitly specifying the path of a module in the
 .D file?
Not to my knowledge. Regan
Sep 10 2007
parent reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
Sorry for not fixing this myself, but I really cannot get D started. I've tried
uppercase/lowercase on everything, and it simply won't work. Here's a DOS
printout to shop you what happens. It seems DMD simply won't traverse the
subdirectories of Phobos.

C:\DMD\SRC>path
PATH=C:\WINDOWS;C:\WINDOWS\SYSTEM32;C:\DMD\BIN;C:\CM\BIN

C:\DMD\SRC>dmd voxel.d -v
parse     voxel
semantic  voxel
import    object        (c:\dmd\src\phobos\object.d)
import    math  (math.d)
voxel.d(11): module math cannot read file 'math.d'

C:\DMD\SRC>dir phobos\std\math.*
Content of C:\DMD\SRC\phobos\std
2007-06-17  22:12            48 512 math.d

C:\DMD\SRC>type ..\bin\sc.ini
[Version]
version=7.51 Build 020

[Environment]
LIB="c:\dmd\lib";\dm\lib
DFLAGS="-Ic:\dmd\src\phobos"
LINKCMD=C:\dm\bin\link.exe
Sep 11 2007
next sibling parent Johannes <getridofcrap.johannes.oberg gmail.com> writes:
...And for those wondering about my typo C:\CM\BIN, it doesn't change anything.
Sep 11 2007
prev sibling next sibling parent reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
...and the problem lies not in voxel.d; I get the same error compiling the
following program:

import math;
int main() {}

And it doesn't matter which module I import.

I'm using D 1.0 v1.016, reports itself as v1.015 (Downloaded a few minutes ago).
Sep 11 2007
parent Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 ...and the problem lies not in voxel.d; I get the same error compiling the
following program:
 
 import math;
 int main() {}
 
 And it doesn't matter which module I import.
 
 I'm using D 1.0 v1.016, reports itself as v1.015 (Downloaded a few minutes
ago).
The import statement "import math;" is not correct (assuming you want the phobos/std/math.d, try: import std.math; int main() {} Does it give the same error? Regan p.s. "import math;" would try to import math.d in the phobos/ directory or the directory specified in -I or the current dir.
Sep 11 2007
prev sibling parent reply Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 Sorry for not fixing this myself, but I really cannot get D started. I've
tried uppercase/lowercase on everything, and it simply won't work. Here's a DOS
printout to shop you what happens. It seems DMD simply won't traverse the
subdirectories of Phobos.
 
 C:\DMD\SRC>path
 PATH=C:\WINDOWS;C:\WINDOWS\SYSTEM32;C:\DMD\BIN;C:\CM\BIN
 
 C:\DMD\SRC>dmd voxel.d -v
 parse     voxel
 semantic  voxel
 import    object        (c:\dmd\src\phobos\object.d)
 import    math  (math.d)
 voxel.d(11): module math cannot read file 'math.d'
Does voxel.d contain the import statement "import math;"? If so, change that to "import std.math;", does that fix it? If not, find out what file does i.e. maybe c:\dmd\src\phobos\object.d does (seems unlikely to me). Regan
Sep 11 2007
parent reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
Thanks, that fixed my problem. I didn't realize D's method of converting dots
to slashes. Wierd way actually, but ok it does the job.

Anyway, now I get alot of compile errors from Tinyptc.d and voxel.d. Both by
Pavel Minayev. It seems the TinyPTC port is far from finished at this point, so
I'm giving up, might take a shot at porting when I get up to speed on D.

Btw, is #digitalmars.D reachable through the standard USENET channels in any
way? I've noticed Dejanews doesn't index any of the channels Web-News reads.
Sep 11 2007
next sibling parent Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 Thanks, that fixed my problem. I didn't realize D's method of
 converting dots to slashes. Wierd way actually, but ok it does the
 job.
 
 Anyway, now I get alot of compile errors from Tinyptc.d and voxel.d.
 Both by Pavel Minayev. It seems the TinyPTC port is far from finished
 at this point, so I'm giving up, might take a shot at porting when I
 get up to speed on D.
 
 Btw, is #digitalmars.D reachable through the standard USENET channels
 in any way? I've noticed Dejanews doesn't index any of the channels
 Web-News reads.
I believe people go direct to the news server at news.digitalmars.com. IIRC Walter has tried to get other news servers to index these groups without luck. Regan
Sep 11 2007
prev sibling parent Carlos Santander <csantander619 gmail.com> writes:
Johannes escribió:
 Thanks, that fixed my problem. I didn't realize D's method of converting dots
 to slashes. Wierd way actually, but ok it does the job.
 
 Anyway, now I get alot of compile errors from Tinyptc.d and voxel.d. Both by
 Pavel Minayev. It seems the TinyPTC port is far from finished at this point,
 so I'm giving up, might take a shot at porting when I get up to speed on D.
 
I'm not familiar with TinyPTC or Voxel, but Pavel hasn't been around for a long, long, long time, so most likely those modules are for old DMD versions.
 Btw, is #digitalmars.D reachable through the standard USENET channels in any
 way? I've noticed Dejanews doesn't index any of the channels Web-News reads.
-- Carlos Santander Bernal
Sep 11 2007
prev sibling next sibling parent reply Kirk McDonald <kirklin.mcdonald gmail.com> writes:
Johannes wrote:
 First, is there any way other than Web-News to search the D forum
 archives? Or any way of making an inclusive search with Web-News?
 
 Anyway, I'm trying to compile some examples under D for Windows,
 under Windows XP SP2. I've placed the files in the proper places in
 C:\DM, C:\DMD and C:\D\LIB and C:\D\IMPORT. (I know DOS well) I've
 also set up the path to the C:\DM\BIN and C:\DMD\BIN dirs.
 
 Somehow the D compiler can't find the Import modules no matter what,
 unless I copy them all to the same folder.
 
Where did the c:\d\ directory come from? I think you're making this more complicated than it is: Just extract dmc.zip somewhere, then extract dmd.zip to the same place. Add dm\bin and dmd\bin to the path, and you're done.
 Does D work for Windows or is it an untested source release?
 
Windows is DMD's primary platform.
 Is there any way of explicitly specifying the path of a module in the
 .D file?
No. You just need to make sure the module is on the import path, which is specified with the -I option. The default import path includes dmd\src\phobos (where the standard library lives), and the current working directory. -- Kirk McDonald http://kirkmcdonald.blogspot.com Pyd: Connecting D and Python http://pyd.dsource.org
Sep 10 2007
parent reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
 (Kirk McDonald:) Where did the c:\d\ directory come from?
From the wiki4d "Evaulation Guide". I tried just making \DMD and \DM first, and setting the path in different ways. The program I'm specifically trying to compile right now is TinyPTC (which has cast syntax errors btw).
 Add dm\bin and dmd\bin to the path, and you're done.
Could this be some wierd thing with Windows XP not using the same path system as real DOS?
Sep 11 2007
parent reply Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 (Kirk McDonald:) Where did the c:\d\ directory come from?
From the wiki4d "Evaulation Guide". I tried just making \DMD and \DM first, and setting the path in different ways. The program I'm specifically trying to compile right now is TinyPTC (which has cast syntax errors btw).
 Add dm\bin and dmd\bin to the path, and you're done.
Could this be some wierd thing with Windows XP not using the same path system as real DOS?
If you want DMD to look for imports or libs in these paths: C:\D\LIB C:\D\IMPORT you need to tell it to, using -I on the command line (for imports, not sure what you use for libs), or by editing sc.ini (which works for both and is the easiest solution by far - just remember that if you upgrade dmd it will get overwritten so keep a backup). It's as simple as that. Regan
Sep 11 2007
parent reply Johannes <getridofcrap.johannes.oberg gmail.com> writes:
Regan Heath Wrote:
 If you want DMD to look for imports or libs in these paths:
    C:\D\LIB    C:\D\IMPORT
 you need to tell it to, using -I on the command line
 It's as simple as that.
Thanks but this is not my problem.
Sep 11 2007
parent Regan Heath <regan netmail.co.nz> writes:
Johannes wrote:
 Regan Heath Wrote:
 If you want DMD to look for imports or libs in these paths:
    C:\D\LIB    C:\D\IMPORT
 you need to tell it to, using -I on the command line
 It's as simple as that.
Thanks but this is not my problem.
No, indeed it's not. I understand what you're saying now :) I'll reply some more in the other thread of this topic. Regan
Sep 11 2007
prev sibling parent reply Fabian <fabian.lindgren gmail.com> writes:
Johannes Wrote:

 First, is there any way other than Web-News to search the D forum archives? Or
any way of making an inclusive search with Web-News?
 
 Anyway, I'm trying to compile some examples under D for Windows, under Windows
XP SP2. I've placed the files in the proper places in C:\DM, C:\DMD and
C:\D\LIB and C:\D\IMPORT. (I know DOS well) I've also set up the path to the
C:\DM\BIN and C:\DMD\BIN dirs.
 
 Somehow the D compiler can't find the Import modules no matter what, unless I
copy them all to the same folder.
 
 Does D work for Windows or is it an untested source release?
 
 Is there any way of explicitly specifying the path of a module in the .D file?
I just downloaded dmd, Entice and dfl myself. Try using dfl as compiler command instead of dmd, like this: C:\dmd\bin\dfl myform.d -gui Change it under Tools > Compile Command... Works for me, but I don't really know why :)
Sep 11 2007
parent Johannes <getridofcrap.johannes.oberg gmail.com> writes:
I'll check it out, however, the problem was that the program I was trying to
compile (TinyPTC for D) was written in 2002 when the directory tree of phobos
was very different and the D language was also different, and also that the
program was full of bugs.

Now I'm having problems trying to build Tango instead...
Sep 12 2007