Building D from source on Windows

Dmitry Olshansky dmitry.olsh at gmail.com
Thu Jan 16 11:03:02 PST 2014


16-Jan-2014 21:41, Andrew Edwards пишет:
> I'm having problems setting up my programming environment on Windows and
> would really appreciate some assistance. Following instructions for
> Windows at [1], everything builds fine, however I cannot build with DMD
> afterwards because of linker errors.
>
> The first such error said that the file C:\D\dmd2\windows\bin\link.exe
> was missing. I moved a copy of link.exe from an from v2.064.2 to that
> location to try to remedy the situation. It did not work I was bombarded
> with a slew of errors like the one bellow:
>

I'd suggest getting a fresh optlink. Walter posted ftp links to it not 
long ago (DigitalMars public FTP).

it would help to know when exactly this problem comes up. I guess 
bulding Phobos?
>      ..\druntime\lib\druntime.lib(thread)
>      Error 35: Cannot Reach TARGET from FRAME at Relative 00041H from
> Segment _TEXT
>      Segment _TEXT
>      FRAME  = Frame of Group FLAT 000000H
>      TARGET = External Symbol
> _D4core6thread6Thread7sm_thisC4Core6thread6Thread 93D24H
>      FIXUP Type = Unknown Type
>      --- errorlevel 1342
>
It could also mean that you are trying to link x64 object files with 
optlink.Being dump the tool thinks that it's a 32bit object just 
horribly broken. x64 requires its own section in sc.ini and MS Visual 
Studio with.

Try specifying model directly:
make MODEL=32 -fwin32.mak

and if it doesn't help clean it first and try again:
make MODEL=32 -fwin32.mak clean
make MODEL=32 -fwin32.mak

Also - always first build druntime, then Phobos. Always with the same MODEL.

I've found that to cleanly build x64 and 32 on windows I have to run 
clean between builds (unlike in Linux/MacOS).


-- 
Dmitry Olshansky


More information about the Digitalmars-d-learn mailing list