我有一个简单的win32程序用于基本的opengl绘图.它将使用gcc编译,但如果我使用g ++它会给我错误:
minimal.c: In function 'HWND__* CreateOpenGLWindow(char*, int, int, int, int, BYTE, DWORD)':
minimal.c:130:24: error: cannot convert 'HDC {aka HDC__*}' to 'HWND {aka HWND__*}' for argument '1' to 'int ReleaseDC(HWND, HDC)'
ReleaseDC(hDC, hWnd);
^
minimal.c: In function 'int WinMain(HINSTANCE, HINSTANCE, LPSTR, int)':
minimal.c:160:24: error: cannot convert 'HDC {aka HDC__*}' to 'HWND {aka HWND__*}' for argument '1' to 'int ReleaseDC(HWND, HDC)'
ReleaseDC(hDC, hWnd);
Run Code Online (Sandbox Code Playgroud)
我不知道为什么它会用gcc编译但是当我使用g ++时会失败?
这是代码:
#include <windows.h> /* must include this before GL/gl.h */
#include <GL/gl.h> /* OpenGL header file …Run Code Online (Sandbox Code Playgroud)