'htons' was not declared in this scope ndk
#include <sys/endian.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
如果是在ndk下,引用如下即可:
#include <sys/endian.h>
如果是在linux下开发,引用如下即可:
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif