Comment #0 by andrej.mitrovich — 2012-09-27T18:33:03Z
Make a .d file in a foo directory, then run:
$ dmd foo/test.d
ok
$ dmd foo/test.d -offoo/main.exe
OPTLINK (R) for Win32 Release 8.00.12
Copyright (C) Digital Mars 1989-2010 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Warning 9: Unknown Option : MAIN
OPTLINK : Warning 9: Unknown Option : MAIN.EXE
user32.def(0) : Error 2: File Not Found user32.def
--- errorlevel 1
DMD should try to normalize the -of path by changing forward slashes to backslashes since Optlink reserves forward slashes for flags.
Comment #1 by andrej.mitrovich — 2012-09-29T16:58:38Z
*** Issue 8736 has been marked as a duplicate of this issue. ***
Comment #2 by andrej.mitrovich — 2012-10-03T20:33:23Z
(In reply to comment #1)
> *** Issue 8736 has been marked as a duplicate of this issue. ***
Guys is this safe to implement this way?:
mars.c:
void toWinPath(char* src)
{
if (src != NULL)
{
while (*src != '\0')
{
if (*src == '/')
*src = '\\';
src++;
}
}
}
case 'f':
if (!p[3])
goto Lnoarg;
#if TARGET_WINDOS
toWinPath(p + 3);
#endif
It works in simple cases but I'm worried about any Unicode issues and of course UNC paths and whatnot. Is there any standard WinAPI/DMC API function that normalizes the path (converts '/' to '\')?
Comment #3 by andrej.mitrovich — 2012-11-24T15:42:59Z