Trouble with building LDC on Windows, specifically with building libconfig

Johan via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Wed Jul 22 14:19:25 PDT 2015


On Tuesday, 21 July 2015 at 07:46:32 UTC, Eappen Nelluvelil wrote:
>
> I gave up on building on Windows. I was running into all sorts 
> of issues with Ninja and libconfig, and I couldn't get ldc to 
> link against libconfig.all.a. I'm going to assume it's most 
> likely an issue with my toolchain, because msys2 is kinda 
> broken for me, and Cygwin wasn't faring any better. Good news 
> is that I got a Lubuntu virtual machine up and running, and I 
> after an hour or so of hunting down some needed packages, I got 
> ldc up and running successfully :) I'll keep looking into the 
> issues with building ldc on Windows (for some odd reason, MSVC 
> wasn't working either, and it ended up having to do with 
> libconfig). Oh well :P Thanks for helping me out Kai!

I am back on D development after a short break, and I am 
rebuilding my build setup ;)
Just now I succeeded building LDC on Windows using MSVC 2015 
Community + LLVM 3.7 + libconfig-1.4.9.
Next week I'll have time to fix up the wiki page on how to build 
LDC, but I believe it is pretty much as described there. I jotted 
down some hints below, hope this helps.

I built libconfig by following these instructions from the wiki 
page:

Alternative you can use a custom CMakeLists.txt:
- Extract libconfig source.
- Download CMakeLists.txt from this gist and place it into the 
root folder.
- Create a build directory: md build_libconfig
- cd build_libconfig
- Now create the build files:
   cmake ..\libconfig-1.4.9

Then, I opened 'libconfig++.sln' in MSVC 2015, changed the 
'active solution platform' to x64 (some clicking involved), then 
Ctrl+Shift+B for build. The build output ends with
"2>  libconfig++.vcxproj -> 
E:\libconfig-1.4.9\build_msvc2015\x64\Debug\libconfig++.lib"
So that's where the .lib file went, which is needed for the cmake 
command to build LDC.

To build LDC, I have a 'run_cmake.bat' file in a separate 'build' 
folder in the ldc checkout, that contains:

cmake -G Ninja -DCMAKE_INSTALL_PREFIX="E:/ldc_msvc/ldc37/install" 
-DCMAKE_CXX_FLAGS="/DWIN32 /D_HAS_EXCEPTIONS=0 /MP /W2 /GR- /GS- 
/d2Zi+" -DLLVM_ROOT_DIR="E:/ldc_msvc/LLVM37" 
-DLIBCONFIG_INCLUDE_DIR="E:/libconfig-1.4.9/lib" 
-DLIBCONFIG_LIBRARY="E:/libconfig-1.4.9/build_msvc2015/x64/Debug/libconfig++.lib" ..



More information about the digitalmars-d-ldc mailing list