On Wednesday, 7 September 2022 at 23:01:34 UTC, Mike Parker wrote:
On Wednesday, 7 September 2022 at 20:23:03 UTC, Injeckt wrote:

Convert it to D:

extern(C) const(char)* inet_ntop(int af, const(void)* src, char* dst, socklen_t size);

Win32 API functions need to be `extern(Windows)`.


You probably also need:

        alias socklen_t = ...;

https://github.com/dlang/dmd/blob/master/druntime/src/core/sys/windows/winsock2.d#L17

`alias socklen_t = int`



It doesn't work. "Reference to an unresolved external symbol _inet_ntop".

That's a linker error. You need to link with `ws2_32.lib`.

Thank you so much. Now It works!

Reply via email to