Building DlangIde

Petar Petar
Sun Sep 24 11:14:46 UTC 2017


On Saturday, 23 September 2017 at 14:43:15 UTC, Flaze07 wrote:
> hi, I am trying to build DlangIde for windows...(if Dlangide is 
> not available for windows...well, I am terribly sorry)
> and here is how it turns out
> C:\Users\User\Documents\GitHub\dlangide>dub clean-caches
>
> C:\Users\User\Documents\GitHub\dlangide>dub upgrade 
> --force-remove
> Upgrading project in C:\Users\User\Document
>
> C:\Users\User\Documents\GitHub\dlangide>dub build -- force
> Performing "debug" build using dmd for x86.
> emsi_containers 0.5.3: building configuration "library"...
> libdparse 0.7.1: building configuration "library"...
> dsymbol 0.2.9: building configuration "library"...
> msgpack-d 1.0.0-beta.6: building configuration "library"...
> dcd 0.9.1: building configuration "library"...
> derelict-util 2.0.6: building configuration "library"...
> derelict-ft 1.1.3: building configuration "library"...
> derelict-gl3 1.0.23: building configuration "library"...
> derelict-sdl2 2.0.2: building configuration "library"...
> dlangui 0.9.142: building configuration "default"...
> dlangide ~master: building configuration "default"...
> Linking...
> Error: linker exited with status 1
> dmd failed with exit code 1.
>
> C:\Users\User\Documents\GitHub\dlangide>

Hi Flaze,

In general, the best place to report issues and request and 
enhancements is on the specific page of each project, in this 
case: https://github.com/buggins/dlangide/issues

I wasn't able to compile DlangIDE via DMD and its Optlink linker, 
however LDC worked:

On Windows 10 x64, with C++ toolchain installed via MS Visual 
Studio 2017 Community (CL Version 19.11.25506; 
https://docs.microsoft.com/en-us/visualstudio/install/install-visual-studio) and LDC 1.4 (https://github.com/ldc-developers/ldc/releases/download/v1.4.0/ldc2-1.4.0-win64-msvc.zip) extracted to "C:\D\ldc2-1.4.0-win64-msvc" and "C:\D\ldc2-1.4.0-win64-msvc\bin" added to the Path environment variable, I was able to get DlangIDE to run via the following two commands:

dub fetch dlangide
dub run dlangide --compiler=ldc2

(Same as "C:\D\ldc2-1.4.0-win64-msvc\bin\dub" run dlangide 
--compiler="C:\D\ldc2-1.4.0-win64-msvc\bin\ldc2.exe", if you 
haven't added ldc's bin folder to your path.)

Applications that are available on code.dlang.org (such as 
http://code.dlang.org/packages/dlangide) can be download via dub, 
so no need to use git.
After you fetch them, 'dub run' will look for them in its 
packages folder (e.g. "%APPDATA%\dub\packages\" on Windows and 
"~/.dub/packages/" on Linux), download all their dependencies, 
compile them and then compile and link the application with them.

DMD 2.076.0 (installed via the installer) + VS 2017 C++ toolchain 
also worked:

(I removed %APPDATA%\dub just for illustration. A simple 'dub 
run' followed by a different compiler and architecture should 
just work without any manual intervention, as dub puts the output 
files in different directories per each different setting.)

C:\Users\ZombineDev>dub fetch dlangide
Fetching dlangide 0.7.89...
Please note that you need to use `dub run <pkgname>` or add it to 
dependencies of your package to actually use/run it. dub does not 
do actual installation of packages outside of its own ecosystem.

C:\Users\ZombineDev>dub run dlangide --compiler=dmd --arch=x86_64
Building package dlangide in 
C:\Users\ZombineDev\AppData\Roaming\dub\packages\dlangide-0.7.89\dlangide\
Fetching dcd 0.9.1 (getting selected version)...
Fetching msgpack-d 1.0.0-beta.6 (getting selected version)...
Fetching dsfml 2.1.1 (getting selected version)...
Fetching libdparse 0.7.1 (getting selected version)...
Fetching dsymbol 0.2.9 (getting selected version)...
Fetching dlangui 0.9.142 (getting selected version)...
Fetching derelict-util 2.0.6 (getting selected version)...
Fetching x11 1.0.19 (getting selected version)...
Fetching derelict-gl3 1.0.23 (getting selected version)...
Fetching derelict-ft 1.1.3 (getting selected version)...
Fetching derelict-sdl2 2.0.2 (getting selected version)...
Fetching emsi_containers 0.5.3 (getting selected version)...
Performing "debug" build using dmd for x86_64.
emsi_containers 0.5.3: building configuration "library"...
libdparse 0.7.1: building configuration "library"...
dsymbol 0.2.9: building configuration "library"...
msgpack-d 1.0.0-beta.6: building configuration "library"...
dcd 0.9.1: building configuration "library"...
derelict-util 2.0.6: building configuration "library"...
derelict-ft 1.1.3: building configuration "library"...
derelict-gl3 1.0.23: building configuration "library"...
derelict-sdl2 2.0.2: building configuration "library"...
dlangui 0.9.142: building configuration "default"...
dlangide 0.7.89: building configuration "default"...
Linking...
Copying files for dlangui...
Copying files for dlangide...
Running 
.\AppData\Roaming\dub\packages\dlangide-0.7.89\dlangide\bin\dlangide.exe

Getting the code via git should work just as well:

C:\code>git clone https://github.com/buggins/dlangide
Cloning into 'dlangide'...
remote: Counting objects: 5445, done.
remote: Compressing objects: 100% (167/167), done.
remote: Total 5445 (delta 180), reused 174 (delta 95), 
pack-reused 5173
Receiving objects: 100% (5445/5445), 6.62 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (3267/3267), done.

C:\code>cd dlangide

C:\code\dlangide>dub run --compiler=dmd --arch=x86_64
Performing "debug" build using dmd for x86_64.
emsi_containers 0.5.3: target for configuration "library" is up 
to date.
libdparse 0.7.1: target for configuration "library" is up to date.
dsymbol 0.2.9: target for configuration "library" is up to date.
msgpack-d 1.0.0-beta.6: target for configuration "library" is up 
to date.
dcd 0.9.1: target for configuration "library" is up to date.
derelict-util 2.0.6: target for configuration "library" is up to 
date.
derelict-ft 1.1.3: target for configuration "library" is up to 
date.
derelict-gl3 1.0.23: target for configuration "library" is up to 
date.
derelict-sdl2 2.0.2: target for configuration "library" is up to 
date.
dlangui 0.9.142: building configuration "default"...
dlangide 0.7.89: building configuration "default"...
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Copying files for dlangui...
Copying files for dlangide...
Running .\bin\dlangide.exe

So in summary, make sure to have VS 2017 Community C++ toolchain 
installed and build either with LDC, or DMD, but in 'x86_64' mode 
or 'x86_mscoff'. The 'x86' arch causes dmd to use its Optlink 
linker, which for some reason has a problem with DlangIDE. Since 
LDC doesn't support Optlink, there's no 'x86_mscoff' dub arch and 
you have to use just 'x86'.
So working combinations are:

dub run --compiler=dmd --arch=x86_mscoff
dub run --compiler=dmd --arch=x86_64

dub run --compiler=ldc2 --arch=x86
dub run --compiler=ldc2 --arch=x86_64


More information about the Digitalmars-d-ide mailing list