I'm trying to compile beej's guide to network programming examples, but Windows XP doesn't have such a function. I'm using mingw, if it makes any difference.
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- 如何让cmd.exe 执行 UNICODE 文本格式的批处理?
- 怎么把Windows开机按钮通过修改注册表指向我自己的程序
- Warning : HTML 1300 Navigation occured?
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
If you're only dealing with IPv4 addresses, you can use
inet_ntoa
. It's available on Windows 2000 or later. Otherwise you'll have to either require Vista and later, or write your own inet_ntop function.You could also look at boost - the boost::asio has an
inet_ntop
implementation that works in Windows:boost::asio::detail::socket_ops::inet_ntop
. You can see the source code here.you can use winsocket with mingw-64 on windows 7
linkwith
Target: x86_64-w64-mingw32 Thread model: win32 gcc version 6.3.0 (GCC)
From the winsock layer: WSAAddressToString (ntop) and WSAStringToAddress (pton)
There is also
inet_ntop
function in POSIX compliant libc for Windows (PlibC) library that was created for porting POSIX applications to Windows. There is no notes about it in online documentation, but it exists in fileinet_ntop.c
at least since 2008 (according to file date).