www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - tango module object cannot read file object.d

reply Martin d Anjou <point14 magma.ca> writes:
  $ /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
Feb 04 2007
next sibling parent reply kris <foo bar.com> writes:
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
Feb 04 2007
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
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.
Feb 04 2007
prev sibling parent Martin d Anjou <point14 magma.ca> writes:
 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
Feb 04 2007