杨庆荣的博客

工作之余接单:公司产品展示网站建设、电商网站建设、小程序、app开发。+86 13714715608

小试windows sdk 7.1中的编译器

点击 14523    创建时间 2013-03-30 00:01:20

windows sdk7是一款免费的开发工具集,其中就包括了c++编译器。从windows网站上下载下来,然后安装上。以前安装几次都没有安装上,后来装了一些更新,结果安装上了。

在目录D:/projects/vc10/test中添加两个文件:

make.bat

 @set "PATH=D:\Program Files\Microsoft SDKs\Windows\v7.1\Bin;%PATH%"  
 @set "INCLUDE=D:\Program Files\Microsoft SDKs\Windows\v7.1\Include;%INCLUDE%"  
 @set "LIB=D:\Program Files\Microsoft SDKs\Windows\v7.1\Lib;%LIB%"  
 @set "LIBPATH=D:\Program Files\Microsoft Visual Studio 10.0\VC\lib;%LIBPATH%"  
 call "D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"  
 cl.exe wudimei.cpp  
 wudimei.exe  
 pause

wudimei.cpp

 #include <iostream>  
 int main(){  
    printf("hello, wudimei.com !");  
    return 0;  
 }

双击make.bat,一会就编译成功了!


    D:\projects\vc10\test>call "D:\Program Files\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
Setting environment for using Microsoft Visual Studio 2010 x86 tools.

D:\projects\vc10\test>cl.exe wudimei.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

wudimei.cpp
D:\Program Files\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : warning
C4530: C++ exception handler used, but unwind semantics are not enabled. Specify
 /EHsc
Microsoft (R) Incremental Linker Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:wudimei.exe
wudimei.obj

D:\projects\vc10\test>wudimei.exe
hello,wudimei.com

D:\projects\vc10\test>pause
请按任意键继续. . .

上一篇: wordpress用来做公司网站很不错的
下一篇: cl.exe编译dll,并使用dll