《WINDOWS核心编程》的源程序编译不了是什么问题?

我在网上下了该书的源程序,在本机编译第一个程序ErrorShow,错误如下:  
   
  Compiling...  
  ErrorShow.cpp  
  You   are   not   using   the   latest   Platform   SDK   header/library    
  files.   This   may   prevent   the   project   from   building   correctly.
 
  d:/程序案例/vc/windows核心编程/windows核心编程源码/cmnhdr.h(212)   :   error   C2065:   'GetWindowLongPtr'   :   undeclared   identifier  
  d:/程序案例/vc/windows核心编程/windows核心编程源码/cmnhdr.h(212)   :   error   C2065:   'GWLP_HINSTANCE'   :   undeclared   identifier  
  d:/程序案例/vc/windows核心编程/windows核心编程源码/01-errorshow/errorshow.cpp(83)   :   error   C2065:   'PCTSTR'   :   undeclared   identifier  
  d:/程序案例/vc/windows核心编程/windows核心编程源码/01-errorshow/errorshow.cpp(83)   :   error   C2146:   syntax   error   :   missing   ')'   before   identifier   'LocalLock'  
  d:/程序案例/vc/windows核心编程/windows核心编程源码/01-errorshow/errorshow.cpp(83)   :   error   C2059:   syntax   error   :   ')'  
  d:/程序案例/vc/windows核心编程/windows核心编程源码/01-errorshow/errorshow.cpp(125)   :   error   C2664:   'DialogBoxParamA'   :   cannot   convert   parameter   4   from   'long   (struct   HWND__   *,unsigned   int,unsigned   int,long)'   to   'int   (__stdcall   *)(struct   HWND__   *,unsig  
  ned   int,unsigned   int,long)'  
                  None   of   the   functions   with   this   name   in   scope   match   the   target   type  
  Error   executing   cl.exe.  
   
  01   ErrorShow.exe   -   6   error(s),   0   warning(s) 

 

 

解决方法:

 

 安装好sdk,然后配置路径  
   
  TOOL-》option-》direction下  
   
  在include下,添加  
  C:/PROGRAM   FILES/MICROSOFT   SDK/INCLUDE  
   
  在lib下,添加  
   
  C:/PROGRAM   FILES/MICROSOFT   SDK/LIB  
   
  这里假设sdk的安装路径是C:/PROGRAM   FILES/MICROSOFT   SDK  
   
  然后记得把这些添加的路径上移到第一的位置,切记 

 

下面给出几个SDK下载地址:

  http://msdn.microsoft.com/zh-cn/windows/bb980924.aspx?wt.svl=more_downloads该网址包含了所有版本的SDK

 

http://bbs.ghtt.net/thread-155927-1-1.html这个链接也很好

 

http://www.microsoft.com/downloads/details.aspx?FamilyID=0baf2b35-c656-4969-ace8-e4c0c0716adb&displaylang=en  VC6.0所需SDK地址


 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值