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;
}