codeblocksd

Compiling D with Code::Blocks


I'm having trouble compiling D programs in Code::Blocks. Here's what I'm doing:

  1. In accordance with my organization conventions, I have unzipped the Digital Mars D2 compiler to C:\Compilers\dmd2. I also have the Digital Mars C/C++ compiler at C:\Compilers\dm.
  2. For the "Toolchain executables" tab in the "Global compiler settings" window, I have set the fields to...
    • Compiler installation directory: C:\Compilers\dmd2\windows
    • C compiler: dmd.exe
    • C++ compiler: dmd.exe
    • Linker for dynamic libs: dmd.exe
    • Linker for static libs: lib.exe
    • Debugger: windbg.exe
    • Resource compiler: rcc.exe (This is the default file, which does not exist. I'm not sure what to set this to.)
    • Make program: make.exe
  3. I have the following listed as additional paths:
    • C:\Compilers\dmd2\windows\lib
    • C:\Compilers\dmd2\windows\bin

When I start a new D project, I do not see any syntax highlighting. Attempting to compile and run a simple "hello world" program results in the following error:

"Hello World in D - Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping... Nothing to be done.

What am I doing incorrectly?


Solution

  • After playing around a bit I finally got it to work.

    I did a complete reinstall of everything Code::Blocks and Digital Mars.

    When I was reinstalling Code::Blocks, I opted-in to the D lexer (which gives me syntax highlighting).

    In the new D compiler folder, I removed the folders for Linux and OSX and moved the files from the Windows folder into the main folder.