c++中关于htonl(),ntohl()的编译错误
按照网上的说法,导入头文件
#include <winsock2.h>
#pragma comment(lib, "ws2_32.lib")
但是在调用htonl(),ntohl()函数的时候总是错误,提示如下:
`htonl' was not declared in this scope Country.cpp
`ntohl' was not declared in this scope Country.cpp
(在原来的windows系统中我并没有搜到WS2_32.Lib文件,该文件是我从vc6.0安装目录下拷贝过来,winsock2.h则是MinGW自带的include目录下面。)
请教各位,这个问题怎么解决?