Cmake problems compiling kdelibs on OS X.

Tanner Lovelace clubjuggler at gmail.com
Thu Jan 26 17:19:23 CET 2006


In attempting to compile kdelibs on OS X, I've run into the attached compile
errors.  It appears the following lines in ConfigureChecks.cmake aren't
correctly finding the function prototypes:

check_prototype_exists(gethostname "stdlib.h;unistd.h" HAVE_GETHOSTNAME_PROTO)
check_prototype_exists(initgroups
"unistd.h;sys/types.h;unistd.h;grp.h" HAVE_INITGROUPS_PROTO)

Looking at the check_prototype_exists macro (in
kdelibs/cmake/modules/CheckPrototypeExists.cmake) it appears that the
problem is the specification of multiple header files.  The macro itself
appears to pass the header variable directly into an include statement
and in this case tries to compile a program with this include line:

#include <stdlib.h;unistd.h>

which obviously doens't work at all.  Alex, can you suggest a
work around?  My first thought was to duplicate the line twice
and have it check each file separately but I believe that if the
prototype is in the first include file and not the second the
HAVE_GETHOSTNAME_PROTO type variable, while being defined
by the first line, would be undefined by the second.

Cheers,
Tanner Lovelace
--
Tanner Lovelace
clubjuggler at gmail dot com
http://wtl.wayfarer.org/
(fieldless) In fess two roundels in pale, a billet fesswise and an
increscent, all sable.
-------------- next part --------------
Building CXX object dcop/CMakeFiles/DCOP.dir/dcopclient.o
/usr/bin/c++   -DDCOP_EXPORTS   -fPIC -I/Users/lovelace/src/kde/kdelibs/dcop -I/Users/lovelace/src/kde/kdelibs/kdecore -I/Users/lovelace/src/kde/kdelibs/kdeui -I/Users/lovelace/src/kde/kdelibs/kio/kio -I/Users/lovelace/src/kde/kdelibs/libltdl -I/Users/lovelace/src/kde/kdelibs/kio/kfile -I/Users/lovelace/src/kde/kdelibs/interfaces -I/Users/lovelace/src/kde/kdelibs/kio -I/Users/lovelace/src/kde/kdelibs/kio/kssl -I/Users/lovelace/src/kde/kdelibs/kdefx -I/usr/local/Trolltech/Qt-4.1.0/include -I/usr/local/Trolltech/Qt-4.1.0/lib/QtCore.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/lib/QtGui.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/lib/Qt3Support.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/include/QtAssistant -I/usr/local/Trolltech/Qt-4.1.0/include/QtDesigner -I/usr/local/Trolltech/Qt-4.1.0/lib/QtNetwork.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/lib/QtOpenGL.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/lib/QtSql.framework/Headers -I/usr/local/Trolltech/Qt-4.1.0/lib/QtXml.framework/Headers -I/Users/lovelace/src/kde/kdelibs -I/usr/X11R6/include -I/Users/lovelace/src/kde/kdelibs-build -I/Users/lovelace/src/kde/kdelibs-build/dcop   -F/usr/local/Trolltech/Qt-4.1.0/lib -DQT3_SUPPORT -DQT_NO_STL -DQT_NO_CAST_TO_ASCII -DQT_NO_TRANSLATION -D_REENTRANT -DHAVE_CONFIG_H=1 -DICE_t -DTRANS_SERVER -DTRANS_CLIENT -DUNIXCONN -DANSICPP -o dcop/CMakeFiles/DCOP.dir/dcopclient.o -c /Users/lovelace/src/kde/kdelibs/dcop/dcopclient.cpp
In file included from /Users/lovelace/src/kde/kdelibs-build/config.h:336,
                 from /Users/lovelace/src/kde/kdelibs/dcop/dcopclient.cpp:33:
/usr/include/unistd.h:207: error: declaration of C function `int
   gethostname(char*, int)' conflicts with
/Users/lovelace/src/kde/kdelibs-build/config.h:327: error: previous declaration
   `int gethostname(char*, unsigned int)' here
In file included from /Users/lovelace/src/kde/kdelibs/dcop/dcopclient.cpp:33:
/Users/lovelace/src/kde/kdelibs-build/config.h:340: error: declaration of C
   function `int initgroups(const char*, unsigned int)' conflicts with
/usr/include/unistd.h:216: error: previous declaration `int initgroups(const
   char*, int)' here
In file included from /Users/lovelace/src/kde/kdelibs/dcop/dcopclient.cpp:35:
/Users/lovelace/src/kde/kdelibs-build/config.h:327: error: declaration of C
   function `int gethostname(char*, unsigned int)' conflicts with
/usr/include/unistd.h:207: error: previous declaration `int gethostname(char*,
   int)' here
make[2]: *** [dcop/CMakeFiles/DCOP.dir/dcopclient.o] Error 1
make[1]: *** [dcop/CMakeFiles/DCOP.dir/all] Error 2
make: *** [all] Error 2                         







More information about the Kde-buildsystem mailing list