现在的位置: 首页 > 综合 > 正文

Windows开发环境搭建

2013年07月07日 ⁄ 综合 ⁄ 共 2046字 ⁄ 字号 评论关闭

申明:下面的链接在你看到的时候可能已经失效,那么你可以去微软网站上搜索相关词语找到相应资源

一、C/C++ 环境

如果要使用Windows的特性,那么光有标准C++编译器还不够,还需要使用Windows发布的platform sdk。 一般Windows的IDE环境中包括了一套SDK,比如Visual Studio 6.0里面包括了Microsoft Platform SDK, August 2001 Edition,要想知道怎样使用SDK,那么应该知道怎样使用MSDN(the Microsoft Developer Network),通过查找MSDN,你可以找到Windows SDK中提供的API描述和使用方法。 如果需要进行驱动开发,那么你还需要Windows DDK(Microsoft Windows Driver Development Kit)和文档(Microsoft Windows DDK Documentation)。

推荐学习用搭配
Visual c++ 8.0 Express(Express 版不支持插件,所以你的Visual Assistant用不了,对标准c++语法支持很好)
http://www.microsoft.com/express/download/
最新的windows platform sdk
http://msdn2.microsoft.com/zh-cn/express/aa700755(en-us).aspx
最新的MSDN
http://www.microsoft.com/express/download/msdn/Default.aspx

怎样在Visual c++ 8.0 Express 中使用SDK可以参看http://msdn2.microsoft.com/zh-cn/express/aa700755(en-us).aspx,我翻译过来如下:
1. 下载并安装Visual c++ 8.0 Express
2. 下载并安装Windows platform sdk
3. 打开VC 8.0 Express,选择菜单Options,打开Options对话框,选择Projects and Solutions
    将下面路径添加到相应的地方:

  • Executable files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Bin
  • Include files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Include
  • Library files: C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2/Lib

4.更新corewin_express.vsprops文件,从C:/Program Files/Microsoft Visual Studio 8/VC/VCProjectDefaults 下面找到该文件,将
AdditionalDependencies="kernel32.lib"
改为
AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib"
5.测试你的环境
VC 8.0 Express中,Win32 Windows Application 在Win32 Application Wizard是不能使用的,找到%ProgramFiles%/Microsoft Visual Studio 8/VC/VCWizards/AppWiz/Generic/Application/html/1033/目录下的AppSettings.htm ,打开该文件,将441-444行前面的注释去掉,如下所示:
// WIN_APP.disabled = true;
// WIN_APP_LABEL.disabled = true;
// DLL_APP.disabled = true;
// DLL_APP_LABEL.disabled = true;
保存并关闭,打开VC8,选择菜单File->New,选择Win32->Win32 Console Application template ,完成后按F5键编译并运行该程序。

二、MASM
如果对汇编比较熟悉,那么使用MASM(Microsoft Macro Assembler,微软宏汇编)也是不错的选择,编写MASM程序,对程序的骨架和Windows API有更深刻的了解。

编译器,链接器,资源编辑器,头文件和Lib库,例程可以从下面的网站免费获取
http://www.masm32.com/

如果对MSAM不了解,首先需要一本讲解MASM的书,《Windows环境下32位汇编语言程序设计》是不错的入门书籍,在使用MASM编程之前应该好好看一下这本书。

抱歉!评论已关闭.