I'm trying to build a D project on my Windows machine. It works on mac but I have the following error when building in Windows, I use the command "dub" inside the project and get this at some point :
C:\Users\USER\AppData\Local\dub\packages\tinyredis-2.1.1\tinyredis\source\tinyredis\connection.d(145,30): Error: undefined identifier `EWOULDBLOCK`
dmd failed with exit code 1.
Any ideas why this EWOULDBLOCK variable is not recognized on Windows ?
Here is the part of connection.d where this identifier appears :
private :
void receive(TcpSocket conn, ref byte[] buffer)
{
byte[1024 * 16] buff;
size_t len = conn.receive(buff);
if (conn.blocking)
{
if(len == 0)
throw new ConnectionException("Server closed the connection!");
else if(len == TcpSocket.ERROR)
throw new ConnectionException("A socket error occurred!");
}
else
{
if (len == -1)
{
import core.stdc.errno;
if (errno == EWOULDBLOCK)
{
len = 0;
errno = 0;
}
else
throw new ConnectionException(format("A socket error occurred! errno: %s", errno));
}
}
buffer ~= buff[0 .. len];
debug(tinyredis) { writeln("Response : ", "'" ~ escape(cast(string)buffer) ~ "'", " Length : ", len); }
}
It is not a variable, it is a constant.
The simple answer is, it has not been declared.
But looks to be 'required' as per MSDN for compatibility purposes.
The problem is however, while MSVC's libc may support it, DMC's which is the default (-m32) probably won't. Either way this is a bug and should be reported to both the dependency and to D's bug tracker.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With