#include <windows.h>При сборке выкидывает ошибки:
#include <gl/gl.h>
#include <gl/glu.h>
#include <wingdi.h>
HDC hDC;
HGLRC hRC;
LRESULT APIENTRY WndProc(HWND hWnd,UINT uMsg,WPARAM,LPARAM);
void CreateWin(HINSTANCE hInst){
HWND hWnd;
PIXELFORMATDESCRIPTOR pfd={
sizeof(PIXELFORMATDESCRIPTOR),1,
PFD_DRAW_TO_WINDOW|PFD_SUPPORT_OPENGL|PFD_DOUBLEBUFFER,PFD_TYPE_RGBA
};
WNDCLASSEX wc={sizeof(WNDCLASSEX),CS_HREDRAW|CS_VREDRAW,WndProc,0,0,hInst,0,0,0,0,"ClassName",0};
RegisterClassEx(&wc);
hWnd=CreateWindowEx(0,"ClassName","OpenGL",WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,0,0,hInst,0);
ShowWindow(hWnd,SW_SHOWNORMAL);
UpdateWindow(hWnd);
hDC=GetDC(hWnd);
SetPixelFormat(hDC,ChoosePixelFormat(hDC,&pfd),&pfd);
hRC=wglCreateContext(hDC);wglMakeCurrent(hDC,hRC);
}
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE,LPSTR,int){
MSG msg;
CreateWin(hInstance);while(GetMessage(&msg,0,0,0)){
TranslateMessage(&msg);DispatchMessage(&msg);
}
return 1;
}
LRESULT APIENTRY WndProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam){
switch(uMsg){
case WM_DESTROY: PostQuitMessage(0);
}
return DefWindowProc(hWnd,uMsg,wParam,lParam);
}
void DrawScene(){
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);SwapBuffers(hDC);
}
wn.obj : error LNK2001: unresolved external symbol __imp__wglMakeCurrent@8
wn.obj : error LNK2001: unresolved external symbol __imp__wglCreateContext@4
wn.obj : error LNK2001: unresolved external symbol __imp__glClear@4
Может кто знает в чем дело? Функции wglMakeCurrent,wglCreateContext и glClear описаны header'ах - это я блокнотом посмотрел.