www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Configuring Phobos from the 1-click installer

reply "Moses" <thewrongowl gmail.com> writes:
After using the 1-click Ubuntu installer, I'm having trouble 
figuring out how to import standard library functions for Phobos. 
I get the message:

Error: module io is in file 'std/std/io.d' which cannot be read
import path[0] = /usr/include/dmd/phobos
import path[1] = /usr/include/dmd/druntime/import

Sorry for such a basic question, but I am new to linux. Do I need 
to modify my path, or is Phobos just not located in the right 
directory?
May 10 2014
parent reply =?UTF-8?B?QWxpIMOHZWhyZWxp?= <acehreli yahoo.com> writes:
On 05/10/2014 07:12 PM, Moses wrote:
 After using the 1-click Ubuntu installer, I'm having trouble figuring
 out how to import standard library functions for Phobos. I get the message:

 Error: module io is in file 'std/std/io.d' which cannot be read
Judging from the repeated stds up there I think you put a dot before io: import std.std.io; // <-- WRONG The second dot should not be there. Do this instead: import std.stdio; // <-- correct Ali
May 10 2014
parent reply "Moses" <thewrongowl gmail.com> writes:
On Sunday, 11 May 2014 at 04:33:24 UTC, Ali Çehreli wrote:
 On 05/10/2014 07:12 PM, Moses wrote:
 After using the 1-click Ubuntu installer, I'm having trouble 
 figuring
 out how to import standard library functions for Phobos. I get 
 the message:

 Error: module io is in file 'std/std/io.d' which cannot be read
Judging from the repeated stds up there I think you put a dot before io: import std.std.io; // <-- WRONG The second dot should not be there. Do this instead: import std.stdio; // <-- correct Ali
Thanks, I also found that I need to include the flag -I/usr/include/dmd/phobos to get it to compile. I tried doing: export PATH=$PATH:/usr/include/dmd/phobos but apparently I still need the -I flag. Is there another way to get around this?
May 10 2014
next sibling parent "Jack" <Jackoz530 gmail.com> writes:
On Sunday, 11 May 2014 at 05:34:38 UTC, Moses wrote:
 Thanks, I also found that I need to include the flag 
 -I/usr/include/dmd/phobos to get it to compile. I tried doing:

 export PATH=$PATH:/usr/include/dmd/phobos

 but apparently I still need the -I flag. Is there another way 
 to get around this?
You can use an IDE, that's what I did anyway
May 10 2014
prev sibling next sibling parent reply "FreeSlave" <freeslave93 gmail.com> writes:
On Sunday, 11 May 2014 at 05:34:38 UTC, Moses wrote:
 On Sunday, 11 May 2014 at 04:33:24 UTC, Ali Çehreli wrote:
 On 05/10/2014 07:12 PM, Moses wrote:
 After using the 1-click Ubuntu installer, I'm having trouble 
 figuring
 out how to import standard library functions for Phobos. I 
 get the message:

 Error: module io is in file 'std/std/io.d' which cannot be 
 read
Judging from the repeated stds up there I think you put a dot before io: import std.std.io; // <-- WRONG The second dot should not be there. Do this instead: import std.stdio; // <-- correct Ali
Thanks, I also found that I need to include the flag -I/usr/include/dmd/phobos to get it to compile. I tried doing: export PATH=$PATH:/usr/include/dmd/phobos but apparently I still need the -I flag. Is there another way to get around this?
Does your /etc directory contain dmd.conf file? You can add standard flags there Example of dmd.conf: [Environment] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import
May 11 2014
parent "Moses" <thewrongowl gmail.com> writes:
 Thanks, I also found that I need to include the flag 
 -I/usr/include/dmd/phobos to get it to compile. I tried doing:

 export PATH=$PATH:/usr/include/dmd/phobos

 but apparently I still need the -I flag. Is there another way 
 to get around this?
Does your /etc directory contain dmd.conf file? You can add standard flags there Example of dmd.conf: [Environment] DFLAGS=-I/usr/include/dmd/phobos -I/usr/include/dmd/druntime/import
Yes, my dmd.conf file already has those paths.
May 11 2014
prev sibling parent reply Jordi Sayol via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
El 11/05/14 07:34, Moses via Digitalmars-d-learn ha escrit:
 On Sunday, 11 May 2014 at 04:33:24 UTC, Ali Çehreli wrote:
 On 05/10/2014 07:12 PM, Moses wrote:
 After using the 1-click Ubuntu installer, I'm having trouble figuring
 out how to import standard library functions for Phobos. I get the message:

 Error: module io is in file 'std/std/io.d' which cannot be read
Judging from the repeated stds up there I think you put a dot before io: import std.std.io; // <-- WRONG The second dot should not be there. Do this instead: import std.stdio; // <-- correct Ali
Thanks, I also found that I need to include the flag -I/usr/include/dmd/phobos to get it to compile. I tried doing: export PATH=$PATH:/usr/include/dmd/phobos but apparently I still need the -I flag. Is there another way to get around this?
PATH environment variable is not related at all with phobos2 sources paths. All Linux packages (Ubuntu too) includes "-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration file. If you need to explicit pass this argument to dmd compiler, may be due to several reasons. - You've edited your "/etc/dmd.conf" file. - You've created a new "dmd.conf" on your current directory, on you home directory or on dmd command directory (/usr/bin/). Any "dmd.conf" file on these places, overrides "/etc/dmd.conf" Take a look at: $ cat /etc/dmd.conf Regard, -- Jordi Sayol
May 11 2014
parent reply "Moses" <thewrongowl gmail.com> writes:
 PATH environment variable is not related at all with phobos2 
 sources paths.

 All Linux packages (Ubuntu too) includes 
 "-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration file.
 If you need to explicit pass this argument to dmd compiler, may 
 be due to several reasons.

 - You've edited your "/etc/dmd.conf" file.

 - You've created a new "dmd.conf" on your current directory, on 
 you home directory or on dmd command directory (/usr/bin/).

 Any "dmd.conf" file on these places, overrides "/etc/dmd.conf"

 Take a look at:
 $ cat /etc/dmd.conf

 Regard,
I didn't find any extra dmd.conf files, but I found that adding to the top of my D program solved the problem to my satisfaction. Thanks so much for your help.
May 12 2014
parent "Kapps" <opantm2+spam gmail.com> writes:
On Monday, 12 May 2014 at 15:02:54 UTC, Moses wrote:
 PATH environment variable is not related at all with phobos2 
 sources paths.

 All Linux packages (Ubuntu too) includes 
 "-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration 
 file.
 If you need to explicit pass this argument to dmd compiler, 
 may be due to several reasons.

 - You've edited your "/etc/dmd.conf" file.

 - You've created a new "dmd.conf" on your current directory, 
 on you home directory or on dmd command directory (/usr/bin/).

 Any "dmd.conf" file on these places, overrides "/etc/dmd.conf"

 Take a look at:
 $ cat /etc/dmd.conf

 Regard,
I didn't find any extra dmd.conf files, but I found that adding to the top of my D program solved the problem to my satisfaction. Thanks so much for your help.
It really does seem like you have an extra dmd.conf that's being loaded. Type dmd -v abc.d - The first few lines should include what config it's using.
May 12 2014