-
Notifications
You must be signed in to change notification settings - Fork 181
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
Compile error on MinGW 32 (inet_pton) #71
Comments
Hi hexedit, |
Hi. |
this is weird. winsock2.h should include inet_ntop and inet_pton from Windows Vista (https://msdn.microsoft.com/en-us/library/windows/desktop/cc805843%28v=vs.85%29.aspx) - this should be the minimum supported by the library due to the definition of _WIN32_WINNT to 0x600 (https://msdn.microsoft.com/en-us/library/windows/desktop/cc805843%28v=vs.85%29.aspx). There is something still missing here I guess. I am seriously evaluating to implement an internal version of those methods considering the problems that they keep causing on windows. |
I changed the code to avoid the usage of inet_pton and inet_ntop replacing them with getnameinfo (that should have a better support on windows). Can you please let me know if this works for you? |
Now it works fine. PS. Unfortunately, i don't know these functions, but if they're better or more useful, i think this fix: |
Good :) getnameinfo is fine and (in general) much more 'cross-platform' |
Getting this error when compiling with mingw32.
../../src/http_utils.cpp: In function 'void httpserver::http::get_ip_str(const sockaddr_, std::string&, socklen_t)':
../../src/http_utils.cpp:258:17: error: 'inet_ntop' was not declared in this scope
);
^
../../src/http_utils.cpp: In function 'const sockaddr httpserver::http::str_to_ip(const string&)':
../../src/http_utils.cpp:296:52: error: 'inet_pton' was not declared in this scope
inet_pton(AF_INET6, src.c_str(), (void_) &s);
^
../../src/http_utils.cpp:300:51: error: 'inet_pton' was not declared in this scope
inet_pton(AF_INET, src.c_str(), (void_) &s);
^
make[2]: *_* [libhttpserver_la-http_utils.lo] Error 1
make[2]: Leaving directory
/home/Timofey/libhttpserver-master/build/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/home/Timofey/libhttpserver-master/build'make: *** [all] Error 2
uname -a
MINGW32_NT-6.2 HEXEDIT-N56DY 1.0.18(0.48/3/2) 2012-11-21 22:34 i686 Msys
Maybe some missing dependency?
The text was updated successfully, but these errors were encountered: