Please read carefully. This sequence is different than Issue 454. To reproduce problem: Extract dmc.zip to C:\ Extract dmd.172.zip to C:\ Change directory to an alternate drive, for example "cd d:" Create file test.d with the following contents: import std.stdio; void main() { writefln("test"); } set PATH=c:\dm\bin;c:\dmd\bin;%PATH% dmd test.d --- Fails to link because phobos.lib is not found --- Edit c:\dmd\bin\sc.ini to contain the following: LIB="%@P%\..\lib";"%@P%\..\..\dm\lib" dmd test.d --- Still fails to link because phobos.lib is not found --- Edit c:\dm\bin\sc.ini to contain the following: LIB="%@P%\..\lib";"%@P%\..\..\dmd\lib";"%@P%\..\mfc\lib";%LIB% dmd test.d --- Now links successfully ---
Have a similar issue after downloading dmd-win32snapshot-0.4.0.zip from www.fsdev.net and unzipping it to my D: drive. I edited the sc.ini to switch from Tango to Phobos and I got the following error: hello.d ------- import std.stdio; void main() { writefln("Hello World"); } D:\test>dmd hello.d OPTLINK (R) for Win32 Release 8.00.1 Copyright (C) Digital Mars 1989-2004 All rights reserved. SNN.lib Warning 2: File Not Found SNN.lib hello.obj(hello) Error 42: Symbol Undefined ...... To fix, I changed LIB line in D:\dmd-win32snapshot-0.4.0\dmd\dmd\bin\sc.ini as follows: LIB="%@P%\..\lib";\dm\lib - to - LIB="%@P%\..\lib;%@P%\..\..\dm\lib" Can the sc.ini's in dmc and dmd zips be fixed?
If DMD does not require DMC then should sc.ini be modified to the following? [Environment] LIB="%@P%\..\lib";\dm\lib ... - to - [Environment] LIB="%@P%\..\lib" ...
Can someone who uses windows update this bug with it's status for 1.x and 2.x? There's been changes in how dmd is packaged since this was originally filed so I suspect it might be resolved.
(In reply to comment #3) > Can someone who uses windows update this bug with it's status for 1.x and 2.x? > There's been changes in how dmd is packaged since this was originally filed so > I suspect it might be resolved. This has certainly not been an issue since 2.025, when dmd stopped using dmc during compilation. It might also have been fixed in 2.004, when the contents of sc.ini were changed. Still, the change described in comment 2 has not been made in the official download; though I've discovered that my DMD development directory has that form of sc.ini, and I've used it for over a year without any problems. I think it would be a good idea to remove the /dm/lib from dmd/windows/bin/sc.ini It might be responsible for some of the weird linking errors people sometimes get -- I think they might be getting an old lib files from an old dmc installation, if they've corrupted their dmd directory somehow.
Inclusion of dm/lib resolved by https://github.com/D-Programming-Language/dmd/pull/2684