[phobos] std.socket.timeval conflict with core.sys.posix.sys.time.timeval
grahamc001uk at yahoo.co.uk
Mon Aug 29 17:39:48 PDT 2011
If a source module imports both std.socket and core.sys.posix.sys.time (or std.c.linux.linux) then a conflict for the definition of timeval occurs:
The message is:
Error: std.socket.timeval at /usr/include/d/dmd/phobos/std/socket.d(948) conflicts with core.sys.posix.sys.time.timeval at /usr/include/d/dmd/druntime/import/core/sys/posix/sys/time.di(12)
This is on a Linux / Intel x86_64 platform and the phobos distributed with the DMD v2.054 package.
Both definitions are basically the same (a pair of 64 bit integers) but are sufficiently different to cause the compilation error. Is there any easy fix for this ?
If I change the structure name in socket.d I presume the whole library needs to be recompiled from it's source so that the mangled names match. There aren't many instructions in the github source on how to recompile. Do I just download the druntime and phobos source trees, do a make -f posix.mak MODEL=64 and change the install path to suit my machine (/usr/lib64) or is it more complicated than this ?
More information about the phobos