www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - D under Linux Mint

reply "snow" <marcel.patzwahl googlemail.com> writes:
Hello, Ive tried to install D under Linux and followed the steps
described on . this page http://dlang.org/dmd-linux.html . I
checked all folders after every step and everything is where it
should be. In the secound step I did both, adding dmd to the PATH
and copied the executables into the lib folder. If I type dmd
into the console, I get back all infos about D, so this is
already working. But if I try to run a simple Hello world program
like this:

import std.stdio;

void main() {
	writeln("Hallo Welt");
	}

I get the following error:
object.d: Error: module object is in file 'object.d' which cannot
be read
import path[0] = /usr/local/bin/../../src/phobos
import path[1] = /usr/local/bin/../../src/druntime/import


My DMD folder is in the home directory and the dmd.config
contains this:
[Environment]

DFLAGS=-I% P%/../../src/phobos -I% P%/../../src/druntime/import
-L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch
-L--export-dynamic

I already tried to compile the program with geany and the
console. In the console i trid to compile it as: dmd hello.d and
dmd -c hello.d. But everywhere I get the same errors
May 23 2012
next sibling parent Kevin Cox <kevincox.ca gmail.com> writes:
--001517592bfc81998704c0bb3c7f
Content-Type: text/plain; charset=UTF-8

On May 23, 2012 5:48 PM, "snow" <marcel.patzwahl googlemail.com> wrote:
 Hello, Ive tried to install D under Linux and followed the steps
 described on . this page http://dlang.org/dmd-linux.html . I
 checked all folders after every step and everything is where it
 should be. In the secound step I did both, adding dmd to the PATH
 and copied the executables into the lib folder. If I type dmd
 into the console, I get back all infos about D, so this is
 already working. But if I try to run a simple Hello world program
 like this:

 import std.stdio;

 void main() {
        writeln("Hallo Welt");
        }

 I get the following error:
 object.d: Error: module object is in file 'object.d' which cannot
 be read
 import path[0] = /usr/local/bin/../../src/phobos
 import path[1] = /usr/local/bin/../../src/druntime/import


 My DMD folder is in the home directory and the dmd.config
 contains this:
 [Environment]

 DFLAGS=-I% P%/../../src/phobos -I% P%/../../src/druntime/import
 -L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch
 -L--export-dynamic

 I already tried to compile the program with geany and the
 console. In the console i trid to compile it as: dmd hello.d and
 dmd -c hello.d. But everywhere I get the same errors

It appears that dmd can't find the library files. IIRC object.d is part of the runtime. Check the paths in the error message and try to ensure necessary files are found. --001517592bfc81998704c0bb3c7f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <p><br> On May 23, 2012 5:48 PM, &quot;snow&quot; &lt;<a href=3D"mailto:marcel.patz= wahl googlemail.com">marcel.patzwahl googlemail.com</a>&gt; wrote:<br> &gt;<br> &gt; Hello, Ive tried to install D under Linux and followed the steps<br> &gt; described on . this page <a href=3D"http://dlang.org/dmd-linux.html">h= ttp://dlang.org/dmd-linux.html</a> . I<br> &gt; checked all folders after every step and everything is where it<br> &gt; should be. In the secound step I did both, adding dmd to the PATH<br> &gt; and copied the executables into the lib folder. If I type dmd<br> &gt; into the console, I get back all infos about D, so this is<br> &gt; already working. But if I try to run a simple Hello world program<br> &gt; like this:<br> &gt;<br> &gt; import std.stdio;<br> &gt;<br> &gt; void main() {<br> &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0writeln(&quot;Hallo Welt&quot;);<br> &gt; =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br> &gt;<br> &gt; I get the following error:<br> &gt; object.d: Error: module object is in file &#39;object.d&#39; which can= not<br> &gt; be read<br> &gt; import path[0] =3D /usr/local/bin/../../src/phobos<br> &gt; import path[1] =3D /usr/local/bin/../../src/druntime/import<br> &gt;<br> &gt;<br> &gt; My DMD folder is in the home directory and the dmd.config<br> &gt; contains this:<br> &gt; [Environment]<br> &gt;<br> &gt; DFLAGS=3D-I% P%/../../src/phobos -I% P%/../../src/druntime/import<br> &gt; -L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch<br> &gt; -L--export-dynamic<br> &gt;<br> &gt; I already tried to compile the program with geany and the<br> &gt; console. In the console i trid to compile it as: dmd hello.d and<br> &gt; dmd -c hello.d. But everywhere I get the same errors<br> &gt;<br> &gt;</p> <p>It appears that dmd can&#39;t find the library files.=C2=A0 IIRC object.= d is part of the runtime.=C2=A0 Check the paths in the error message and tr= y to ensure necessary files are found.<br> </p> --001517592bfc81998704c0bb3c7f--
May 23 2012
prev sibling next sibling parent "Jonathan M Davis" <jmdavisProg gmx.com> writes:
On Wednesday, May 23, 2012 23:46:23 snow wrote:
 Hello, Ive tried to install D under Linux and followed the steps
 described on . this page http://dlang.org/dmd-linux.html . I
 checked all folders after every step and everything is where it
 should be. In the secound step I did both, adding dmd to the PATH
 and copied the executables into the lib folder. If I type dmd
 into the console, I get back all infos about D, so this is
 already working. But if I try to run a simple Hello world program
 like this:
 
 import std.stdio;
 
 void main() {
 writeln("Hallo Welt");
 }
 
 I get the following error:
 object.d: Error: module object is in file 'object.d' which cannot
 be read
 import path[0] = /usr/local/bin/../../src/phobos
 import path[1] = /usr/local/bin/../../src/druntime/import
 
 
 My DMD folder is in the home directory and the dmd.config
 contains this:
 [Environment]
 
 DFLAGS=-I% P%/../../src/phobos -I% P%/../../src/druntime/import
 -L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch
 -L--export-dynamic
 
 I already tried to compile the program with geany and the
 console. In the console i trid to compile it as: dmd hello.d and
 dmd -c hello.d. But everywhere I get the same errors

Well, is Phobos found in /usr/local/bin/../../src/phobos (i.e. /usr/src/phobos)? I'm assuming not. You need to fix the dmd.conf that you use so that it points to where the source files actually are. So, % P%/../../src/phobos needs to be changed to /path/to/where/phobos/src/is/whatever/that/might/be. The same goes for druntime and the lib64 and lib32 directories (which should be the paths to where libphobos.a is). - Jonathan M Davis
May 23 2012
prev sibling next sibling parent "jerro" <a a.com> writes:
On Wednesday, 23 May 2012 at 21:46:24 UTC, snow wrote:
 Hello, Ive tried to install D under Linux and followed the steps
 described on . this page http://dlang.org/dmd-linux.html . I
 checked all folders after every step and everything is where it
 should be. In the secound step I did both, adding dmd to the 
 PATH
 and copied the executables into the lib folder. If I type dmd
 into the console, I get back all infos about D, so this is
 already working. But if I try to run a simple Hello world 
 program
 like this:

 import std.stdio;

 void main() {
 	writeln("Hallo Welt");
 	}

 I get the following error:
 object.d: Error: module object is in file 'object.d' which 
 cannot
 be read
 import path[0] = /usr/local/bin/../../src/phobos
 import path[1] = /usr/local/bin/../../src/druntime/import


 My DMD folder is in the home directory and the dmd.config
 contains this:
 [Environment]

 DFLAGS=-I% P%/../../src/phobos -I% P%/../../src/druntime/import
 -L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch
 -L--export-dynamic

 I already tried to compile the program with geany and the
 console. In the console i trid to compile it as: dmd hello.d and
 dmd -c hello.d. But everywhere I get the same errors

Do you have a copy of dmd executable and dmd.conf in /usr/local/bin, by any chance? That would explain this:
 import path[0] = /usr/local/bin/../../src/phobos
 import path[1] = /usr/local/bin/../../src/druntime/import

May 23 2012
prev sibling next sibling parent Jordi Sayol <g.sayol yahoo.es> writes:
Al 23/05/12 23:46, En/na snow ha escrit:
 Hello, Ive tried to install D under Linux and followed the steps
 described on . this page http://dlang.org/dmd-linux.html . I
 checked all folders after every step and everything is where it
 should be. In the secound step I did both, adding dmd to the PATH
 and copied the executables into the lib folder. If I type dmd
 into the console, I get back all infos about D, so this is
 already working. But if I try to run a simple Hello world program
 like this:
 
 import std.stdio;
 
 void main() {
     writeln("Hallo Welt");
     }
 
 I get the following error:
 object.d: Error: module object is in file 'object.d' which cannot
 be read
 import path[0] = /usr/local/bin/../../src/phobos
 import path[1] = /usr/local/bin/../../src/druntime/import
 
 
 My DMD folder is in the home directory and the dmd.config
 contains this:
 [Environment]
 
 DFLAGS=-I% P%/../../src/phobos -I% P%/../../src/druntime/import
 -L-L% P%/../lib64 -L-L% P%/../lib32 -L--no-warn-search-mismatch
 -L--export-dynamic
 
 I already tried to compile the program with geany and the
 console. In the console i trid to compile it as: dmd hello.d and
 dmd -c hello.d. But everywhere I get the same errors
 
 
 

In Linux Mint you can install deb packages from http://dlang.org/download.html 32-bit: http://ftp.digitalmars.com/dmd_2.059-0_i386.deb 64-bit: http://ftp.digitalmars.com/dmd_2.059-0_amd64.deb They work out of the box. -- Jordi Sayol
May 23 2012
prev sibling parent "snow" <marcel.patzwahl googlemail.com> writes:
Thank you very much. I wrote the real paths into the dmd.conf and 
there was really a copy of dmd.conf in the usr/local/bin. I 
deleted everything there, except the dmd, dumpobj and the obj2asm 
and now its working.
May 24 2012