VC linker - unresolved external symbols - runtime

deed none at none.none
Sat Nov 9 07:30:54 PST 2013


sc.ini
--------------------
[Environment]
DFLAGS="-I%@P%\..\..\src\phobos" 
"-I%@P%\..\..\src\druntime\import"
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC
WindowsSdkDir=C:\Program Files\Microsoft SDKs\Windows\v7.1
LIB="%@P%\..\lib"

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

[Environment64]
LIB="%@P%\..\lib64";%WindowsSdkDir%\lib\x64
DFLAGS=%DFLAGS% -L/OPT:NOICF
LINKCMD=%VCINSTALLDIR%\bin\amd64\link.exe
VC2010 LINKCMD=%VCINSTALLDIR%\bin\amd64\link.exe
LIB=%LIB%;"%VCINSTALLDIR%\lib\amd64"
LIB=%LIB%;"%WindowsSdkDir%\Lib\win8\um\x64"
LIB=%LIB%;"%WindowsSdkDir%\Lib\x64"
-------------------


build
-------------------
-ofprog.exe
-m64

-L-subsystem:windows

./src/main.d
user32.lib
-------------------


main.d
-------------------
...
int WintMain(...)
{
     ...
     try
     {
         Runtime.initialize();
         ...
         Runtime.terminate();
     }
     ...
}
--------------------

$ dmd @build
error LNK2019: unresolved external symbol 
_D4core7runtime7runtime10initializeFZb referenced in function 
WinMain
error LNK2019: unresolved external symbol 
_D4core7runtime7Runtime9terminateFZb referenced in function 
WinMain

core.runtime's import path is specified in the sc.ini file, in 
DFLAGS
If I specify the core.runtime file in the build file everything 
works

Why is it so?


More information about the Digitalmars-d-learn mailing list