Thread overview
tango module object cannot read file object.d
Feb 05, 2007
Martin d Anjou
Feb 05, 2007
kris
Feb 05, 2007
Martin d Anjou
Feb 05, 2007
Frits van Bommel
February 05, 2007
 $ /tools/bin/dmd -L-L/tools/lib/libphobos.a -I/tools/SRC/tango/tango ttango.d
object.d: module object cannot read file 'object.d'

$ cat /tools/bin/dmd.conf

[Environment]

; DFLAGS=-I/tools/SRC/dmd/dmd/src/phobos
DFLAGS="-I/tools/SRC/tango/tango" -version=Tango -version=Posix

Can someone help me with what's wrong here? Thanks.

Martin
February 05, 2007
Martin d Anjou wrote:
>  $ /tools/bin/dmd -L-L/tools/lib/libphobos.a -I/tools/SRC/tango/tango ttango.d
> object.d: module object cannot read file 'object.d'
> 
> $ cat /tools/bin/dmd.conf
> 
> [Environment]
> 
> ; DFLAGS=-I/tools/SRC/dmd/dmd/src/phobos
> DFLAGS="-I/tools/SRC/tango/tango" -version=Tango -version=Posix
> 
> Can someone help me with what's wrong here? Thanks.
> 
> Martin

It may be that your -I is one level too deep? Looks like it ^^. In general you're likely to get a faster response over at the Tango forums, or the IRC channel, since that's where we spend most of our time :)

http://www.dsource.org/projects/tango/wiki/Contact
February 05, 2007
> It may be that your -I is one level too deep? Looks like it ^^. In general

Yes, that was it.

Now the linker can't find phobos:

$ /tools/bin/dmd -L-L/tools/SRC/tango/lib/libphobos.a -I/tools/SRC/tango ttango.d
gcc ttango.o -o ttango -m32 -lphobos -lpthread -lm -Xlinker -L/tools/SRC/tango/lib/libphobos.a
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lphobos
collect2: ld returned 1 exit status
--- errorlevel 1
$ file /tools/SRC/tango/lib/libphobos.a
/tools/SRC/tango/lib/libphobos.a: current ar archive

So phobos is there... but why the error?

Martin
February 05, 2007
Martin d Anjou wrote:
> Now the linker can't find phobos:
> 
> $ /tools/bin/dmd -L-L/tools/SRC/tango/lib/libphobos.a -I/tools/SRC/tango ttango.d
> gcc ttango.o -o ttango -m32 -lphobos -lpthread -lm -Xlinker -L/tools/SRC/tango/lib/libphobos.a
> /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.6/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lphobos
> collect2: ld returned 1 exit status
> --- errorlevel 1
> $ file /tools/SRC/tango/lib/libphobos.a
> /tools/SRC/tango/lib/libphobos.a: current ar archive
> 
> So phobos is there... but why the error?

Because it can't find the library specified by -lphobos. just like it says?
Try dropping the '/libphobos.a' from the -L. -L is for specifying the *directory* to look for libraries, not the library itself.