Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Got C4996 problem when using it into my project #23

Open
wzf-cn opened this issue Feb 25, 2020 · 0 comments
Open

Got C4996 problem when using it into my project #23

wzf-cn opened this issue Feb 25, 2020 · 0 comments

Comments

@wzf-cn
Copy link

wzf-cn commented Feb 25, 2020

Hi,
The example could be run correctly along in a project. But when I include this code into my project, the error came out.

c4996 'inet_addr':Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings

I had followed the solution in the stackoverflow, included the "Ws2tcpip.h" and changed the line 127 and line 205 in the influxdb.hpp as follows, then the program returned -3.

// For line 127
InetPton(AF_INET, (PCWSTR)(host.c_str()), &addr.sin_addr.s_addr);
if (addr.sin_addr.s_addr == INADDR_NONE) return -1;
// For line 205
InetPton(AF_INET, (PCWSTR)(si.host_.c_str()), &addr.sin_addr.s_addr);
if (addr.sin_addr.s_addr == INADDR_NONE) return -1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant