Thread overview | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
September 10, 2007 New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
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? |
September 10, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | 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 |
September 10, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | 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 |
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirk McDonald | > (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? |
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | 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
|
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | 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 |
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Regan Heath | 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.
|
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | ...And for those wondering about my typo C:\CM\BIN, it doesn't change anything. |
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | ...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). |
September 11, 2007 Re: New to D, path errors under WinXP | ||||
---|---|---|---|---|
| ||||
Posted in reply to Johannes | 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.
|
Copyright © 1999-2021 by the D Language Foundation