编译环境测试

2017-11-29 09:32:47来源:CSDN作者:season1201人点击

分享

1、设置环境变量

C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin

C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE

/I "../include" 添加头文件查找路径

C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/INCLUDE;

C:/Program Files(x86)/Microsoft Visual Studio 10.0/VC/ATLMFC/INCLUDE;

C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/include;


/libpath:"../PublicSDK/lib"//指定外部lib查找路径

C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/LIB;
C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/ATLMFC/LIB;
C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/lib;

命令行下执行C:/Program Files/Microsoft Visual Studio 10.0/Common7/Tools/vsvars32.bat(设置环境变量lib include)

cl /c /D "UNICODE" /EHsc main.cpp 

link /subsystem:console user32.lib main.obj  

#include <stdio.h>
#include <tchar.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf("hello world");
getchar();
return 0;
}

最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台