Dmd sc.ini and VS do not work well together!

Igor via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 23 13:38:19 PST 2016


I feel like I am in the cave man times.  I installed Dmd2 from 
scratch. VisualD x64 project would not compile due to libucrt.lib 
not being found.

Using Process Monitor, it seems that dmd is looking all over the 
place for libucrt.lib but can't find it. Check out sci.ini has 
some weird results.

I have installed some windows kits and sdk's for win 8.1 and win 
10 but I do not remember all the details.

What I do know is that I have about 20 libucrt's in on my 
harddrive(global search).


1. The archaic sc.ini file gets things backwards. It uses 
VCINSTALLDIR before it is defined!


This is the exact file generated on my system minus the comments:

[Version]
version=7.51 Build 020
; environment for both 32/64 bit
[Environment]
DFLAGS="-I%@P%\..\..\src\phobos" 
"-I%@P%\..\..\src\druntime\import"
LIB="%@P%\..\lib"

[Environment32]
LIB="%@P%\..\lib"
LINKCMD=%@P%\link.exe

[Environment64]
LIB="%@P%\..\lib64"
DFLAGS=%DFLAGS% -L/OPT:NOICF
LINKCMD=%VCINSTALLDIR%\bin\link.exe ;;; <<<<<<<<<<< UM, Where is 
VCINSTALLDIR?

VCINSTALLDIR=C:\PF\VS2015\VC\
WindowsSdkDir=C:\PF\Windows Kits\8.1\
UniversalCRTSdkDir=C:\PF\Windows\Kits\10\
UCRTVersion=winv6.3
LINKCMD=%VCINSTALLDIR%\bin\x86_amd64\link.exe
PATH=%PATH%;%VCINSTALLDIR%\bin\x86_amd64;%VCINSTALLDIR%\bin
LIB=%LIB%;"%VCINSTALLDIR%\lib\amd64"
LIB=%LIB%;"%UniversalCRTSdkDir%\Lib\%UCRTVersion%\um\x64"
LIB=%LIB%;"%UniversalCRTSdkDir%\Lib\%UCRTVersion%\ucrt\x64"
LIB=%LIB%;"%WindowsSdkDir%\Lib\winv6.3\um\x64"
LIB=%LIB%;"%WindowsSdkDir%\Lib\win8\um\x64"
LIB=%LIB%;"%WindowsSdkDir%\Lib\x64"
LIB=%LIB%;"%DXSDK_DIR%\Lib\x64"

[Environment32mscoff]
LIB="%@P%\..\lib32mscoff"
DFLAGS=%DFLAGS% -L/OPT:NOICF
VCINSTALLDIR=C:\PF\VS2015\VC\
WindowsSdkDir=C:\PF\Windows Kits\8.1\
UniversalCRTSdkDir=C:\PF\Windows\Kits\10\
UCRTVersion=winv6.3
LINKCMD=%VCINSTALLDIR%\bin\link.exe
PATH=%PATH%;%VCINSTALLDIR%\bin
LIB=%LIB%;"%VCINSTALLDIR%\lib"
LIB=%LIB%;"%UniversalCRTSdkDir%\Lib\%UCRTVersion%\um\x86"
LIB=%LIB%;"%UniversalCRTSdkDir%\Lib\%UCRTVersion%\ucrt\x86"
LIB=%LIB%;"%WindowsSdkDir%\Lib\winv6.3\um\x86"
LIB=%LIB%;"%WindowsSdkDir%\Lib\win8\um\x86"
LIB=%LIB%;"%WindowsSdkDir%\Lib"
LIB=%LIB%;"%DXSDK_DIR%\Lib\x86"



Um, So, first off VCINSTALLDIR is used before defined!! Pretty 
basic bug here, should never have happened. Second, UCRTVersion 
is just wrong. I have no winv6.3 subdir. Windows 10 and VS2015 
use some folder names like

C:\PF\Windows\Kits\10\Lib\10.0.10150.0
and
C:\PF\Windows\Kits\10\Lib\10.0.10240.0


Which contains the libucrt libs. It seems the installer is pretty 
ignorant of reality and almost surely not designed by someone 
that uses windows as a development platform. As of now I 
personally cannot use dmd to build windows apps. I imagine there 
are other people in similar situations with similar build setups.

The installer should be modernized and provide path information 
and resolve dependencies properly before installing. It is clear 
that dmd was not designed for windows use.




More information about the Digitalmars-d mailing list