私はGLFWなしでWindows上でOpenGLを初期化しようとしています...彼女の関連コード:
#include <windows.h>
//...
if(!(g_hDC = GetDC(hWnd)))
return false;
if(!(iPixelFormat = ChoosePixelFormat(g_hDC, &pfdPixelFormat)))
return false;
if(!SetPixelFormat(g_hDC, iPixelFormat, &pfdPixelFormat))
return false;
if(!(g_hRC = wglCreateContext(g_hDC)))
return false;
if(!wglMakeCurrent(g_hDC, g_hRC))
return false;
//...
mingw32-g++ -Wall -O2 -Wl,--subsystem,windows -lopengl32 -mwindows Init.c でコンパイルすると、次のエラーが発生します。
Temp\cclcIFFB.o:init.c:(.text+0x281): undefined reference to `_wglCreateContext@4'
Temp\cclcIFFB.o:init.c:(.text+0x2a0): undefined reference to `_wglMakeCurrent@8'
collect2.exe: error: ld returned 1 exit status
このリンカ エラーが発生するのはなぜですか?