Building lates D-Bus for Windows with MS yields a fatal error for not finding 'sys/types.h sys/socket.h'

rony rony at wu.ac.at
Sat Apr 18 09:55:01 PDT 2015


Hi there,

attempting to create a Windows version of the latest DBus code yields a fatal error while CMake is
trying to create the Makefile (for MS Visual C compiler) with:

    cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=E:/Programme/dbus-20150418 -DEXPAT_INCLUDE_DIR=E:/Programme/Expat_2.1.0/Source/lib F:/work/git/dbus-win-20150418/dbus/cmake

The output of the above is:

    -- The C compiler identification is MSVC 16.0.30319.1
    -- The CXX compiler identification is MSVC 16.0.30319.1
    -- Check for working C compiler: E:/Programme/Microsoft Visual Studio 10.0/VC/bin/cl.exe
    -- Check for working C compiler: E:/Programme/Microsoft Visual Studio 10.0/VC/bin/cl.exe -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working CXX compiler: E:/Programme/Microsoft Visual Studio 10.0/VC/bin/cl.exe
    -- Check for working CXX compiler: E:/Programme/Microsoft Visual Studio 10.0/VC/bin/cl.exe -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    CMake Error at modules/MacrosAutotools.cmake:121 (file):
      file Internal CMake error when trying to open file:
      F:/work/git/dbus-win-20150418/dbus/cmake/../config.h.in for reading.
    Call Stack (most recent call first):
      CMakeLists.txt:27 (autoheaderchecks)


    -- Found EXPAT: E:/Programme/Expat_2.1.0/Bin/libexpat.lib (found version "2.1.0")
    -- Could NOT find GLIB2 (missing:  GLIB2_LIBRARIES GLIB2_MAIN_INCLUDE_DIR)
    -- Could NOT find PkgConfig (missing:  PKG_CONFIG_EXECUTABLE)
    -- Could NOT find GOBJECT (missing:  GOBJECT_LIBRARIES GOBJECT_INCLUDE_DIR)
    -- Looking for alloca.h
    -- Looking for alloca.h - not found
    -- Looking for byteswap.h
    -- Looking for byteswap.h - not found
    -- Looking for crt/externs.h
    -- Looking for crt/externs.h - not found
    -- Looking for dirent.h
    -- Looking for dirent.h - not found
    -- Looking for dlfcn.h
    -- Looking for dlfcn.h - not found
    -- Looking for execinfo.h
    -- Looking for execinfo.h - not found
    -- Looking for errno.h
    -- Looking for errno.h - found
    -- Looking for expat.h
    -- Looking for expat.h - not found
    -- Looking for grp.h
    -- Looking for grp.h - not found
    -- Looking for inttypes.h
    -- Looking for inttypes.h - not found
    -- Looking for io.h
    -- Looking for io.h - found
    -- Looking for locale.h
    -- Looking for locale.h - found
    -- Looking for memory.h
    -- Looking for memory.h - found
    -- Looking for signal.h
    -- Looking for signal.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stdlib.h
    -- Looking for stdlib.h - found
    -- Looking for stdio.h
    -- Looking for stdio.h - found
    -- Looking for string.h
    -- Looking for string.h - found
    -- Looking for strings.h
    -- Looking for strings.h - not found
    -- Looking for syslog.h
    -- Looking for syslog.h - not found
    -- Looking for 3 include files stdint.h, ..., sys/event.h
    -- Looking for 3 include files stdint.h, ..., sys/event.h - not found
    -- Looking for sys/inotify.h
    -- Looking for sys/inotify.h - not found
    -- Looking for sys/resource.h
    -- Looking for sys/resource.h - not found
    -- Looking for sys/stat.h
    -- Looking for sys/stat.h - found
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for sys/uio.h
    -- Looking for sys/uio.h - not found
    -- Looking for sys/poll.h
    -- Looking for sys/poll.h - not found
    -- Looking for sys/prctl.h
    -- Looking for sys/prctl.h - not found
    -- Looking for sys/syslimits.h
    -- Looking for sys/syslimits.h - not found
    -- Looking for sys/time.h
    -- Looking for sys/time.h - not found
    -- Looking for sys/wait.h
    -- Looking for sys/wait.h - not found
    -- Looking for time.h
    -- Looking for time.h - found
    -- Looking for ws2tcpip.h
    -- Looking for ws2tcpip.h - found
    -- Looking for unistd.h
    -- Looking for unistd.h - not found
    -- Looking for backtrace
    -- Looking for backtrace - not found
    -- Looking for getgrouplist
    -- Looking for getgrouplist - not found
    -- Looking for getpeerucred
    -- Looking for getpeerucred - not found
    -- Looking for nanosleep
    -- Looking for nanosleep - not found
    -- Looking for getpwnam_r
    -- Looking for getpwnam_r - not found
    -- Looking for setenv
    -- Looking for setenv - not found
    -- Looking for unsetenv
    -- Looking for unsetenv - not found
    -- Looking for clearenv
    -- Looking for clearenv - not found
    -- Looking for writev
    -- Looking for writev - not found
    -- Looking for setrlimit
    -- Looking for setrlimit - not found
    -- Looking for socketpair
    -- Looking for socketpair - not found
    -- Looking for setlocale
    -- Looking for setlocale - found
    -- Looking for localeconv
    -- Looking for localeconv - found
    -- Looking for strtoll
    -- Looking for strtoll - not found
    -- Looking for strtoull
    -- Looking for strtoull - not found
    -- Looking for pipe2
    -- Looking for pipe2 - not found
    -- Looking for accept4
    -- Looking for accept4 - not found
    -- Looking for dirfd
    -- Looking for dirfd - not found
    -- Looking for inotify_init1
    -- Looking for inotify_init1 - not found
    -- Looking for SCM_RIGHTS
    -- Looking for SCM_RIGHTS - not found
    -- Looking for prctl
    -- Looking for prctl - not found
    -- Looking for raise
    -- Looking for raise - found
    -- Performing Test HAVE_CMSGCRED
    -- Performing Test HAVE_CMSGCRED - Failed
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of short
    -- Check size of short - done
    -- Check size of int
    -- Check size of int - done
    -- Check size of long
    -- Check size of long - done
    -- Check size of long long
    -- Check size of long long - done
    -- Check size of __int64
    -- Check size of __int64 - done
    -- Check size of socklen_t
    -- Check size of socklen_t - failed
    -- Copying test files to test directory
    -- Generating test files from templates into test directory
    -- Copying generated bus config files to test directory

    set -DDBUS_INSTALL_SYSTEM_LIBS=1 to install runtime libraries too
    set DBUSDIR (environment or cmake option) to overwrite the default install directory


                      D-BUS 1.9.15
                      ============

            install prefix:           E:/Programme/dbus-20150418
            install exec_prefix:      E:/Programme/dbus-20150418
            install libdir:           E:/Programme/dbus-20150418/lib
            install bindir:           E:/Programme/dbus-20150418/bin
            install sysconfdir:       E:/Programme/dbus-20150418/etc
            install datadir:          E:/Programme/dbus-20150418/share
            source code location:     F:/work/git/dbus-win-20150418/dbus/cmake/..
            build dir:                F:/work/git/dbus-win-20150418/dbus/dbus-build
            c compiler:               cl.exe
            cflags:                    /DWIN32 /D_WINDOWS /W3  -Wsign-compare
            cflags debug:             /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1   /FIconfig.h  /we4028 /we4013 /we4133 /we4047 /we4031 /we
    4002 /we4003 /we4114  /wd4127 /wd4090 /wd4101 /wd4244  -D_DEBUG
            cflags release:           /MD /O2 /Ob2 /D NDEBUG /FIconfig.h  /we4028 /we4013 /we4133 /we4047 /we4031 /we4002 /we4003
     /we4114  /wd4127 /wd4090 /wd4101 /wd4244
            cxx compiler:             cl.exe
            cxxflags:                  /DWIN32 /D_WINDOWS /W3 /GR /EHsc  -Wsign-compare
            cxxflags debug:           /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1
            cxxflags release:         /MD /O2 /Ob2 /D NDEBUG
            64-bit int:               long long
            32-bit int:               int
            16-bit int:               short
            Doxygen:                  DOXYGEN-NOTFOUND
            Docbook Generator:
            gcc coverage profiling:
            Building unit tests:      ON
            Building with GLib:
            Building verbose mode:    ON
            Building w/o assertions:  OFF
            Building w/o checks:      OFF
            Building bus stats API:   OFF
            installing system libs:   OFF
            Building inotify support:
            Building kqueue support:
            Building Doxygen docs:
            Building XML docs:
            Daemon executable name:   dbus-daemon
            System bus address:       unix:path=E:/Programme/dbus-20150418/var/run/dbus/system_bus_socket
            Session bus listens on:   autolaunch:
            Session clients connect to: autolaunch:
            Test listen address:      tcp:host=localhost
            build timestamp:          201504181831


    NOTE: building with unit tests increases the size of the installed library and renders it insecure.
    NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance.
    NOTE: building with assertions increases library size and decreases performance.

    -- Configuring incomplete, errors occurred!
    See also "F:/work/git/dbus-win-20150418/dbus/dbus-build/CMakeFiles/CMakeOutput.log".
    See also "F:/work/git/dbus-win-20150418/dbus/dbus-build/CMakeFiles/CMakeError.log".


CMakeError.log at the end contains the following:

    Performing C++ SOURCE FILE Test HAVE_CMSGCRED failed with the following output:
    Change Dir: F:/work/git/dbus-win-20150418/dbus/dbus-build/CMakeFiles/CMakeTmp

    Run Build Command:"nmake" "/NOLOGO" "cmTryCompileExec2674399229\fast"
    	"E:\Programme\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTryCompileExec2674399229.dir\build.make /nologo -L                  CMakeFiles\cmTryCompileExec2674399229.dir\build

    	E:\Programme\CMake\bin\cmake.exe -E cmake_progress_report F:\work\git\dbus-win-20150418\dbus\dbus-build\CMakeFiles\CMakeTmp\CMakeFiles 1

    Building CXX object CMakeFiles/cmTryCompileExec2674399229.dir/src.cxx.obj

    	E:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe  @D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nm86A.tmp

    src.cxx

    F:\work\git\dbus-win-20150418\dbus\dbus-build\CMakeFiles\CMakeTmp\src.cxx(2) : fatal error C1083: Cannot open include file: *'sys/types.h sys/socket.h'*: No such file or directory

    NMAKE : fatal error U1077: 'E:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe' : return code '0x2'

    Stop.

    NMAKE : fatal error U1077: '"E:\Programme\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'

    Stop.


    Source file was:

    #include <sys/types.h sys/socket.h>

    int main()
    {
       cmsgcred* tmp;
       tmp->cmcred_pid;
      return 0;
    }

    Determining size of socklen_t failed with the following output:
    Change Dir: F:/work/git/dbus-win-20150418/dbus/dbus-build/CMakeFiles/CMakeTmp

    Run Build Command:"nmake" "/NOLOGO" "cmTryCompileExec3636955877\fast"
    	"E:\Programme\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -f CMakeFiles\cmTryCompileExec3636955877.dir\build.make /nologo -L                  CMakeFiles\cmTryCompileExec3636955877.dir\build

    	E:\Programme\CMake\bin\cmake.exe -E cmake_progress_report F:\work\git\dbus-win-20150418\dbus\dbus-build\CMakeFiles\CMakeTmp\CMakeFiles 1

    Building C object CMakeFiles/cmTryCompileExec3636955877.dir/SOCKLEN_T.c.obj

    	E:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe  @D:\DOKUME~1\ADMINI~1\LOKALE~1\Temp\nm895.tmp

    SOCKLEN_T.c

    F:\work\git\dbus-win-20150418\dbus\dbus-build\CMakeFiles\CheckTypeSize\SOCKLEN_T.c(4) : fatal error C1083: Cannot open include file: 'sys/socket.h': No such file or directory

    NMAKE : fatal error U1077: 'E:\PROGRA~1\MICROS~2.0\VC\bin\cl.exe' : return code '0x2'

    Stop.

    NMAKE : fatal error U1077: '"E:\Programme\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2'

    Stop.


    F:/work/git/dbus-win-20150418/dbus/dbus-build/CMakeFiles/CheckTypeSize/SOCKLEN_T.c:
    #include <sys/types.h>
    #include <stdint.h>
    #include <stddef.h>
    #include "sys/socket.h"


    #undef KEY
    #if defined(__i386)
    # define KEY '_','_','i','3','8','6'
    #elif defined(__x86_64)
    # define KEY '_','_','x','8','6','_','6','4'
    #elif defined(__ppc__)
    # define KEY '_','_','p','p','c','_','_'
    #elif defined(__ppc64__)
    # define KEY '_','_','p','p','c','6','4','_','_'
    #endif

    #define SIZE (sizeof(socklen_t))
    char info_size[] =  {'I', 'N', 'F', 'O', ':', 's','i','z','e','[',
      ('0' + ((SIZE / 10000)%10)),
      ('0' + ((SIZE / 1000)%10)),
      ('0' + ((SIZE / 100)%10)),
      ('0' + ((SIZE / 10)%10)),
      ('0' +  (SIZE    % 10)),
      ']',
    #ifdef KEY
      ' ','k','e','y','[', KEY, ']',
    #endif
      '\0'};

    #ifdef __CLASSIC_C__
    int main(argc, argv) int argc; char *argv[];
    #else
    int main(int argc, char *argv[])
    #endif
    {
      int require = 0;
      require += info_size[argc];
      (void)argv;
      return require;
    }


Any hint/help highly appreciated!

---rony

P.S.: Building last summer with the same commands worked, there has been no change in compiler, nor
expat, nor cmake since then.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/dbus/attachments/20150418/132840b5/attachment.html>


More information about the dbus mailing list