手头有一个例子程序,文档上说:重新编译程序需要Microsoft Platform SDK,我下载了SDK并且安装了,结果编译(compile)我的程序没有错误了,但是build还是不能通过,请问sdk要怎么用啊?

解决方案 »

  1.   

    按装之后到VC工程里进行设置路径:
    具体方法:
    TOOLS-》OPTIONS-》DIRECTORIES:
    include files
    library files 
    两个选项下分别加入你的新的PLATFORM SDK 路径(注意要放在VC默认路径的前面!!!)
      

  2.   

    错误信息如下
    --------------------Configuration: MCastSvr - Win32 Release--------------------
    Compiling...
    MCastSvrDlg.cpp
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(148) : error C2065: 'IPPROTO_IPV6' : undeclared identifier
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(149) : error C2065: 'IPV6_MULTICAST_HOPS' : undeclared identifier
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(211) : error C2065: 'IPV6_MULTICAST_LOOP' : undeclared identifier
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(259) : error C2027: use of undefined type 'addrinfo'
            E:\SDK\MCastSvr\MCastSvrDlg.h(63) : see declaration of 'addrinfo'
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(259) : error C2227: left of '->ai_family' must point to class/struct/union
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(264) : error C2027: use of undefined type 'addrinfo'
            E:\SDK\MCastSvr\MCastSvrDlg.h(63) : see declaration of 'addrinfo'
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(264) : error C2227: left of '->ai_addr' must point to class/struct/union
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(264) : error C2227: left of '->sin_addr' must point to class/struct/union
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(264) : error C2228: left of '.S_un' must have class/struct/union type
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(264) : error C2228: left of '.S_addr' must have class/struct/union type
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(265) : error C2027: use of undefined type 'addrinfo'
            E:\SDK\MCastSvr\MCastSvrDlg.h(63) : see declaration of 'addrinfo'
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(265) : error C2227: left of '->ai_addr' must point to class/struct/union
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(265) : error C2227: left of '->sin_addr' must point to class/struct/union
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(265) : error C2228: left of '.S_un' must have class/struct/union type
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(265) : error C2228: left of '.S_addr' must have class/struct/union type
    E:\SDK\MCastSvr\MCastSvrDlg.cpp(267) : error C2027: use of undefined type 'addrinfo'
            E:\SDK\MCastSvr\MCastSvrDlg.h(63) : see declaration of 'addrinfo'
      

  3.   

    在TOOLS-》OPTIONS-》DIRECTORIES:
    include files中将新添加的SDK的目录拖动到最上面。
      

  4.   

    回Kingore(没有希望的过去) 
    工具--〉选择--〉目录   里面我看见已经有这两个目录了
      

  5.   

    把目录设置以后就直接可以像平常的程序一样build,运行吗?