qt - inet_pton not declared in scope -
i'm working on client application , going until try , build on windows 7 machine, project compile , run on vista , linux mint15.
i error inet_pton not declared in scope
on windows 7 , linux use mingw on vista msvc compiler using qt 5.2.0 impression mingw on windows issue? linux using other includes
the includes:
#if defined(win32) #include <windows.h> #include <ws2tcpip.h> #include <wspiapi.h> #include <string> // djm: cannot have <string.h> #include <winsock2.h> #include <stdlib.h> #include <w32api.h> #include <stdio.h> #else #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <unistd.h> #include <arpa/inet.h> #endif bool socket::connect ( const std::string &host, const int port ) { if ( ! is_valid() ) return false; m_addr.sin_family = af_inet; m_addr.sin_port = htons ( port ); int status = inet_pton ( af_inet, host.c_str(), &m_addr.sin_addr ); #ifndef win32 if ( errno == eafnosupport ) return false; #endif status = ::connect ( m_sock, ( sockaddr * ) &m_addr, sizeof ( m_addr ) ); if ( status == 0 ) return true; else return false; }
the includes result of searching answer , nothing seems work :/
i guess quick solution install qt msvc2010, cool if there code option :)
Comments
Post a Comment