{"id":161,"date":"2009-02-10T17:28:22","date_gmt":"2009-02-10T09:28:22","guid":{"rendered":"http:\/\/twycf.com\/wordpress\/?p=161"},"modified":"2009-02-10T17:28:22","modified_gmt":"2009-02-10T09:28:22","slug":"c-builder-winsock-1-%e5%92%8c-winsock-2-header-%e9%87%8d%e8%a4%87%e7%9a%84%e5%95%8f%e9%a1%8c","status":"publish","type":"post","link":"https:\/\/twycf.com\/?p=161","title":{"rendered":"C++ Builder: Winsock 1 \u548c Winsock 2 Header \u91cd\u8907\u7684\u554f\u984c"},"content":{"rendered":"<p>\u4f7f\u7528 Indy \u5143\u4ef6\u6642\uff0c\u6709\u6642\u5019\u6703\u9047\u5230\u5143\u4ef6\u5f15\u7528\u7684\u554f\u984c\uff0c\u5728 Winsock1 \u548c Winsock2 \u7684Header \u88e1\uff0c\u6709\u4e0d\u5c11\u662f\u76f8\u540c\u540d\u5b57\u7684\u5ba3\u544a\uff0c\u800c<\/p>\n<p>\u767c\u751f\u6642\u7684\u932f\u8aa4\u8a0a\u606f\u5982\u4e0b\uff1a<br \/>\n[C++ Error] winsock2.h(113): E2238 Multiple declaration for &#8216;fd_set&#8217;<br \/>\n[C++ Error] winsock.h(55): E2344 Earlier declaration of &#8216;fd_set&#8217;<br \/>\n[C++ Error] winsock2.h(116): E2146 Need an identifier to declare<br \/>\n[C++ Error] winsock2.h(157): E2238 Multiple declaration for &#8216;timeval&#8217;<br \/>\n[C++ Error] winsock.h(98): E2344 Earlier declaration of &#8216;timeval&#8217;<!--more--><br \/>\n[C++ Error] winsock2.h(213): E2238 Multiple declaration for &#8216;hostent&#8217;<br \/>\n[C++ Error] winsock.h(154): E2344 Earlier declaration of &#8216;hostent&#8217;<br \/>\n[C++ Error] winsock2.h(226): E2238 Multiple declaration for &#8216;netent&#8217;<br \/>\n[C++ Error] winsock.h(167): E2344 Earlier declaration of &#8216;netent&#8217;<br \/>\n[C++ Error] winsock2.h(233): E2238 Multiple declaration for &#8216;servent&#8217;<br \/>\n[C++ Error] winsock.h(174): E2344 Earlier declaration of &#8216;servent&#8217;<br \/>\n[C++ Error] winsock2.h(245): E2238 Multiple declaration for &#8216;protoent&#8217;<br \/>\n[C++ Error] winsock.h(186): E2344 Earlier declaration of &#8216;protoent&#8217;<br \/>\n[C++ Error] winsock2.h(401): E2238 Multiple declaration for &#8216;sockaddr_in&#8217;<br \/>\n[C++ Error] winsock.h(322): E2344 Earlier declaration of &#8216;sockaddr_in&#8217;<br \/>\n[C++ Error] winsock2.h(411): E2238 Multiple declaration for &#8216;WSAData&#8217;<br \/>\n[C++ Error] winsock.h(332): E2344 Earlier declaration of &#8216;WSAData&#8217;<br \/>\n[C++ Error] winsock2.h(427): E2146 Need an identifier to declare<br \/>\n[C++ Error] winsock2.h(562): E2238 Multiple declaration for &#8216;sockaddr&#8217;<br \/>\n[C++ Error] winsock.h(495): E2344 Earlier declaration of &#8216;sockaddr&#8217;<br \/>\n[C++ Error] winsock2.h(602): E2238 Multiple declaration for &#8216;sockproto&#8217;<br \/>\n[C++ Error] winsock.h(504): E2344 Earlier declaration of &#8216;sockproto&#8217;<br \/>\n[C++ Error] winsock2.h(641): E2238 Multiple declaration for &#8216;linger&#8217;<br \/>\n[C++ Error] winsock.h(541): E2344 Earlier declaration of &#8216;linger&#8217;<br \/>\n[C++ Error] ws2tcpip.h(29): E2238 Multiple declaration for &#8216;ip_mreq&#8217;<br \/>\n[C++ Error] ws2tcpip.h(29): E2228 Too many error or warning messages<br \/>\n\u7576\u767c\u751f\u9019\u4e9b\u932f\u8aa4\u8a0a\u606f(winsock \u7684 Multiple declaration )\u6642\uff0c\u8acb\u5617\u8a66\u4ee5\u4e0b\u7684\u6b65\u9a5f\u3002<br \/>\nBCB 6 \u4e2d\u6309\u300cProject\/Options\u300d\uff0c\u9ede\u9078\u300cDirectories\/Conditionals\u300d\uff0c\u5728\u300cConditional defines\u300d\u6b04\u4f4d\u4e2d\u52a0\u5165<\/p>\n<p>\u300c_WINSOCKAPI_\u300d\u5b57\u4e32(\u5982\u679c\u5df1\u7d93\u6709\u5176\u4ed6\u7684\u5b9a\u7fa9\uff0c\u8acb\u653e\u524d\u9762\uff0c\u4e26\u4ee5\u5206\u865f\u9694\u958b)\uff0c\u6700\u5f8c\u6309\u300cOK\u300d\uff0c\u7136\u5f8c\u91cd\u65b0\u7de8\u8b6f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 Indy \u5143\u4ef6\u6642\uff0c\u6709\u6642\u5019\u6703\u9047\u5230\u5143\u4ef6\u5f15\u7528\u7684\u554f\u984c\uff0c\u5728 Winsock1 \u548c Winsock2 \u7684Header [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,2],"tags":[22,24,23,25],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-c","category-programming","tag-c-builder-6","tag-indy","tag-multiple-declaration","tag-_winsockapi_"],"_links":{"self":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":0,"href":"https:\/\/twycf.com\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"wp:attachment":[{"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/twycf.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}