需要在BCB的包文件中加入ws2_32.lib的引用, 方法:在project——>options——>linker——>linking页面,右下角的Addictional Options填入ws2_32.lib, 即可,如图: