This simple piece of code in Windows results in an annoying debug message printed by gethostbyname
.
#include <stdio.h>
#include <winsock.h>
int main()
{
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 2), &wsaData);
hostent* he = gethostbyname("www.stackoverflow.com");
char* ip = inet_ntoa(*(struct in_addr*)he->h_addr_list[0]);
printf(ip);
}
it says:
onecore\net\netprofiles\service\src\nsp\dll\namespaceserviceprovider.cpp(550)\nlansp_c.dll!00007FFCFC1FC759: (caller: 00007FFD2856388E) LogHr(1) tid(6e14) 8007277C No such service is known. The service cannot be found in the specified name space.
I'm on Windows. using visual studio 2019. How can I omit that? Currently, I'm debugging and because my log is filled completely with this message, it's hard to find desired logs.