www.digitalmars.com         C & C++   DMDScript  

D - Directry separator in dmd and link

reply Robert <Robert_member pathlink.com> writes:
I use dmd for windows.
The dmd outputs object files as:

dmd -c foo/bar.d  -> foo\bar.obj
dmd -c foo\bar.d  -> .\bar.obj  (Not good!)

And, the linker:

dmd foo/bar.obj   -> It tries to link foo.obj with /BAR option...
dmd foo\bar.obj   -> It works as expected (outputs .\bar.exe.)

If one uses '/' as separator,
compiler is useful but linker is not,
and if '\', opposite.
It's much of a bother!

I think that it's nice if both can be used equivalently.

Robert (Japanese)
Dec 11 2003
parent reply "Walter" <walter digitalmars.com> writes:
Don't use / for a separator under windows, it just doesn't work that well.
To control where the .obj file goes, try the -of flag.

"Robert" <Robert_member pathlink.com> wrote in message
news:br9m53$182q$1 digitaldaemon.com...
 I use dmd for windows.
 The dmd outputs object files as:

 dmd -c foo/bar.d  -> foo\bar.obj
 dmd -c foo\bar.d  -> .\bar.obj  (Not good!)

 And, the linker:

 dmd foo/bar.obj   -> It tries to link foo.obj with /BAR option...
 dmd foo\bar.obj   -> It works as expected (outputs .\bar.exe.)

 If one uses '/' as separator,
 compiler is useful but linker is not,
 and if '\', opposite.
 It's much of a bother!

 I think that it's nice if both can be used equivalently.

 Robert (Japanese)

Dec 11 2003
parent reply Robert <Robert_member pathlink.com> writes:
In article <bramlo$2qp5$1 digitaldaemon.com>, Walter says...
Don't use / for a separator under windows, it just doesn't work that well.
To control where the .obj file goes, try the -of flag.

I use dmd in Cygwin. So, it is convenient if '/' is also available... Robert (Japanese)
Dec 11 2003
next sibling parent reply Robert <Robert_member pathlink.com> writes:
I take that back, sorry.
If '/' is used, compiler/linker can't determine
whether '/foo/bar' is an absolute path or windows flags.

Robert (Japanese)
Dec 11 2003
parent reply J Anderson <REMOVEanderson badmama.com.au> writes:
Robert wrote:

I take that back, sorry.
If '/' is used, compiler/linker can't determine
whether '/foo/bar' is an absolute path or windows flags.

Robert (Japanese)
  

Dec 11 2003
parent reply Robert <Robert_member pathlink.com> writes:
In article <brbgvm$uk1$1 digitaldaemon.com>, J Anderson says...
Robert wrote:

I take that back, sorry.
If '/' is used, compiler/linker can't determine
whether '/foo/bar' is an absolute path or windows flags.

Robert (Japanese)
  


I'm afraid that it didn't work. Robert (Japanese)
Dec 11 2003
parent "Sean L. Palmer" <palmer.sean verizon.net> writes:
"Robert" <Robert_member pathlink.com> wrote in message
news:brbj8e$12nt$1 digitaldaemon.com...
 In article <brbgvm$uk1$1 digitaldaemon.com>, J Anderson says...
Robert wrote:

I take that back, sorry.
If '/' is used, compiler/linker can't determine
whether '/foo/bar' is an absolute path or windows flags.

Robert (Japanese)


I'm afraid that it didn't work. Robert (Japanese)

It seems the Windows or C runtime automatically extracts quoted strings as a unit. Sean
Dec 11 2003
prev sibling parent "Walter" <walter digitalmars.com> writes:
"Robert" <Robert_member pathlink.com> wrote in message
news:brb3ob$c08$1 digitaldaemon.com...
 In article <bramlo$2qp5$1 digitaldaemon.com>, Walter says...
Don't use / for a separator under windows, it just doesn't work that


To control where the .obj file goes, try the -of flag.

I use dmd in Cygwin. So, it is convenient if '/' is also available...

Many folks have run into problems using Cygwin's shell. The / appears to be one of them, another is the shell doesn't seem to handle child process environments (upon which the dmc.exe driver depends) correctly.
Dec 12 2003