Problem compiling Digikam with mingw

Ralf Habacker ralf.habacker at
Mon Nov 1 08:05:13 CET 2010

Am 01.11.2010 03:21, schrieb Francis Corvin:
> At 2010-10-30 21:06, Ralf Habacker wrote:
>> if tdm gcc is different from other mingw distributions the additional
>> compiler has to be defined in  the top level CMakeLists.txt from the
>> kdewin package
>> # there are three mingw compilers
>> # compiler cmake variables
>> # mingw4 MINGW32
>> # mingw-w32 MINGW32 MINGW_W32
>> # mingw-w64 MINGW64 MINGW_W64
>> # the last one could be detected automatically
>> # the second one is selected with the following option
>> # the first one is selected by cmake as default
>> OPTION(MINGW_W32 "build for mingw-w32 " OFF)
>> Depending on this additional compiler the headers in
>> has to be
>> patched.
>> If you send me a related patch I can add this to the kdewin source in svn.
>> Regards
>>    Ralf
> Thanks. I am making some progress. The problem results from the
> combination of two issues. Resolving one of them would be enough.
> 1. lcms.h hard-codes the environment (line 46). This is part of the
> Windows MinGW package:
>           #define NON_WINDOWS  1
> This later causes the conflicting include (which is in an ifdef
> NON_WINDOWS section).
> A potential fix is to #undef NON_WNDOWS in lcms.h. Why would it be
> hard-coded? Even then, compilation falls over quite dramatically if
> it is not there. Is there a way to define LCMSEXPORT and LCMSAPI in a
> way that is compatible with TDM_GCC?
For the KDE on windows community release build system there are already 
patches used to build lcms, see 
I guess additional definitions could be set by extending the patch.

May be using the available CMakeLists.txt from the same location will 
make it more easier.

> 2. The compiler looks for unistd.h in the KDE installation include
> path* rather than in the TDM-GCC include paths**.
> * The directory where I install KDE: E:\kde4-tdmgcc\include
> ** The directories where I installed TDM-GCC and the source code:
> E:\dev-tdmgcc\include and E:\dev-tdmgcc\lib\gcc\mingw32\4.5.1\include
> Another potential fix is to change the include path hierarchy, but I
> don't know the makefile generation process well enough to identify
> where to make the changes. Any clues?
The kdewin package is intended to add missing system header and to add 
missing definitions in system headers. This required to have them in 
search path first. kdewin headers will include related system headers 
from the compiler dirs see

23     #include <sys/types.h>
24     #include <../include/unistd.h>
26     #include <winsock2.h>
27     #include <process.h>
28     #include <io.h>
30     #define environ _environ

so changing the search order will break many other packages and fix 1 
will fit better.


More information about the Kde-windows mailing list