Posts Tagged ‘QTD’


QTD compile error using DMD (Solved)

I’ve just been struggling to build QTD on my Ubuntu box.  QTD is the D programming language binding for the QT framework.  The error I was getting was:

CMake Error at cmake/FindD.cmake:41 (message):
  D compiler is not found
Call Stack (most recent call first):
  CMakeLists.txt:65 (FIND_PACKAGE)

This is strange because DMD is installed. After some investigation I found that the compiler isn’t found because the cmake file (cmake/FindD.cmake) searches for the version using a regex in the output to “dmd” (around line 13):

string(REGEX MATCH "(Digital Mars|DMD32) D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")

This is the guilty line. When I type “dmd” on my command line, the first line looks like this:

DMD64 D Compiler v2.060

This clearly doesn’t match the above regex. To fix the problem you can modify the regex above in the file “cmake/FindD.cmake” to look like the following:

string(REGEX MATCH "(Digital Mars|DMD32|DMD64) D Compiler v[0-9]\\.[0-9]+" dmd_version "${d_output}")

This fixes the problem.