Thread overview
Unexpected OPTLINK termination
Oct 09, 2012
Faux Amis
Oct 09, 2012
Andrej Mitrovic
Oct 09, 2012
Andrej Mitrovic
Oct 10, 2012
Jacob Carlborg
Oct 09, 2012
Faux Amis
October 09, 2012
I get an unexpected OPTLINK termination when I run the lovely thing below, any advice (dmd 2.060)?

rdmd --chatty --force --build-only ..\lib\libcairo-2.lib -I..\include ..\lib\libcairod.lib ..\lib\dmd_win32_x32.lib -version=Unicode -version=WIN32_WINNT_ONLY -version=WindowsNTonly -version=Windows2000 -version=Windows2003 -version=WindowsXP -version=WindowsVista -version=CAIRO_HAS_PS_SURFACE -version=CAIRO_HAS_PDF_SURFACE -version=CAIRO_HAS_SVG_SURFACE -version=CAIRO_HAS_WIN32_SURFACE -version=CAIRO_HAS_PNG_FUNCTIONS -version=CAIRO_HAS_WIN32_FONT -L-Subsystem:Windows main.d

"dmd" "..\lib\libcairo-2.lib" "-I..\include" "..\lib\libcairod.lib" "..\lib\dmd_win32_x32.lib" "-version=Unicode" "-version=WIN32_WINNT_ONLY" "-version=WindowsNTonly" "-version=Windows2000" "-version=Windows2003" "-version=WindowsXP" "-version=WindowsVista" "-version=CAIRO_HAS_PS_SURFACE" "-version=CAIRO_HAS_PDF_SURFACE" "-version=CAIRO_HAS_SVG_SURFACE" "-version=CAIRO_HAS_WIN32_SURFACE" "-version=CAIRO_HAS_PNG_FUNCTIONS" "-version=CAIRO_HAS_WIN32_FONT" "-L-Subsystem:Windows" "-v" "-o-" "main.d" "-I."
"dmd" "@C:\Users\FA\AppData\Local\Temp\.rdmd\rdmd-main.d-3E1D6779F7085177FB593D4351477E84\rdmd.rsp"
[terminate]

On a side-note, why is rdmd picky about argument order?

>dmd test.d -I..\include
test.d(2): Error: module missing is in file 'missing.d' which cannot be read
import path[0] = ..\include
import path[1] = C:\_Prog\D\dmd2\windows\bin\..\..\src\phobos
import path[2] = C:\_Prog\D\dmd2\windows\bin\..\..\src\druntime\import

>rdmd test.d -I..\include
test.d(2): Error: module missing is in file 'missing.d' which cannot be read
import path[0] = .
import path[1] = C:\_Prog\D\dmd2\windows\bin\..\..\src\phobos
import path[2] = C:\_Prog\D\dmd2\windows\bin\..\..\src\druntime\import

>rdmd -I..\include test.d
test.d(2): Error: module missing is in file 'missing.d' which cannot be read
import path[0] = ..\include
import path[1] = .
import path[2] = C:\_Prog\D\dmd2\windows\bin\..\..\src\phobos
import path[3] = C:\_Prog\D\dmd2\windows\bin\..\..\src\druntime\import
October 09, 2012
On 10/9/12 12:30 PM, Faux Amis wrote:
> On a side-note, why is rdmd picky about argument order?
>
>  >dmd test.d -I..\include

Because anything after the program is considered an argument to the program.

Andrei
October 09, 2012
On 10/9/12, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
> On 10/9/12 12:30 PM, Faux Amis wrote:
>> On a side-note, why is rdmd picky about argument order?
>>
>>  >dmd test.d -I..\include
>
> Because anything after the program is considered an argument to the program.
>
> Andrei
>

I think this is a fairly common user error. Perhaps we could consider introducing --args which would treat all args as compiler args except the ones set with --args which are for the app itself?
October 09, 2012
On 10/9/12 4:38 PM, Andrej Mitrovic wrote:
> On 10/9/12, Andrei Alexandrescu<SeeWebsiteForEmail@erdani.org>  wrote:
>> On 10/9/12 12:30 PM, Faux Amis wrote:
>>> On a side-note, why is rdmd picky about argument order?
>>>
>>>   >dmd test.d -I..\include
>>
>> Because anything after the program is considered an argument to the
>> program.
>>
>> Andrei
>>
>
> I think this is a fairly common user error. Perhaps we could consider
> introducing --args which would treat all args as compiler args except
> the ones set with --args which are for the app itself?

I'd be bummed because that's quite a logical decision, and how other interpreters do it.

Andrei
October 09, 2012
On 10/9/12, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
> I'd be bummed because that's quite a logical decision, and how other interpreters do it.

On second thought my solution wouldn't work. --args would still have to be passed before the D file, and people would have to remember that or it wouldn't work, same problem as before.
October 09, 2012
On 09/10/2012 22:30, Andrei Alexandrescu wrote:
> On 10/9/12 12:30 PM, Faux Amis wrote:
>> On a side-note, why is rdmd picky about argument order?
>>
>>  >dmd test.d -I..\include
>
> Because anything after the program is considered an argument to the
> program.
>
> Andrei

My bad, should have read the spec better and not copy my dmd arguments :)
rdmd [dmd and rdmd options] progfile[.d] [program arguments]
dmd [files] [dmd options]
October 10, 2012
On 2012-10-09 22:59, Andrei Alexandrescu wrote:

> I'd be bummed because that's quite a logical decision, and how other
> interpreters do it.

GDB uses the --args approach.

-- 
/Jacob Carlborg