《WINDOWS核心編程》的來源程式編譯不了是什麼問題?

來源:互聯網
上載者:User

我在網上下了該書的來源程式,在原生編譯第一個程式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地址

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.