vs2008编译时找不到windows.h解决办法

开始我按照提示找不到windows.h,便手动下载添加到项目中,在编译时又提示找不到windef.h,如果再按照之前的方法一直做下去不知道要猴年马月。

后来运行2008的控制台  工具—visual Stutio 2008 Command Prompt,运行set命令,发现$(WindowsSdkDir)=D:\coding_office\vs2008\vc\PlatformSdk,按照此路径根本找不到PlatformSdk目录(这可能是由于之前多次安装卸载vs造成的),也就是并没有安装它。于是手动下载将其安装到此路径下,在编译就没有问题啦啦啦啦。

展开阅读全文

请教编译时找不到windows.h”是什么原因

02-28

我是初学者,刚编了个简单的程序,编译时出错,请前辈们帮我看一下:rn源程序:rnrn#includernLRESULT CALLBACK WndProc(HWND,UINT,WPARAM,LPARAM);rnint WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInst,LPSTR lpszCmdLine,int nCmdShow)rnrn HWND hwnd;rn MSG msg;rn WNDCLASS wndclass;rn char lpszClassName[]="窗口";]rn char lpszTitle[]="My_Windows";rnrnrn wndclass.style=0;rn wndclass.lpfnWndProc=WndProc;rn wndclass.cbClsExtra=0;rn wndclass.cbWndExtra=0;rn wndclass.hInstance=hInstance;rn wndclass.hIcon=LoadIcon(NULL,IDI_APPLICATION);rn wndclass.hCursor=LoadCursor(NULL,IDC_ARROW);rn wndclass.hbrBackground=(HBRUSH)GetStockObject(WHITE_BRUSH);rnrn wndclass.lpszMenuName=NULL;rn wndclass.lpszClassName=lpszClassName;rnrn if(!RegisterClass(&wndclass))rn rn MessageBeep(0);rn return FALSE;rnrn rnrnrn hwnd=CreateWindow(rn lpszClassName,rn lpszTitle,rn WS_OVERLAPPEDWINDOW,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn CW_USEDEFAULT,rn NULL,rn hInstance,rn NULL);rn ShowWindow(hwnd,nCmdShow);rn UpdateWindow(hwnd);rn while(GetMessage(&Msg,NULL,0,0))rn rn TranslateMessage(&Msg);rn DispatchMessage(&Msg);rn rn return Msg.wparam;rnrn LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam)rn rn switch(message)rn rn case WM_DESTROY:rn PostQuitMessage(0);rn default:rn return DefWindowProc(hwnd,message,wParam,lParam);rn rn return(0);rn rnrn编译出错信息为:rn-------------------Configuration: exec - Win32 Debug--------------------rnCompiling...rne1.cpprne:\study\vc练习\exec\e1.cpp(1) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directoryrnError executing cl.exe.rnrnexec.exe - 1 error(s), 0 warning(s)rnrn请大家指点,多谢!rn 论坛

没有更多推荐了,返回首页