Using GCC (MinGW) to compile OpenGL on Windows

后端 未结 1 941
旧时难觅i
旧时难觅i 2021-02-06 16:48

I\'ve searched on google and haven\'t been able to come up with a solution.

I would like to compile some OpenGL programming using GCC. In the GL folder in GCC I have th

相关标签:
1条回答
  • 2021-02-06 17:30

    You probably want to run gcc like this:

    gcc -g -Wall hello_gl.c -lopengl32 -lglu32 -lfreeglut
    

    Unfortunately GLUT does not come preinstalled on Windows.

    GLUT is a library that takes care of the (platform specific) job of creating a window and graphic context for you. Many OpenGL samples use it.

    The official GLUT port to Win32 is available here but it's a bit dated.

    I suggest you use the compatible freeglut library instead. You can use this tutorial for setting up freeglut with Mingw32

    0 讨论(0)
提交回复
热议问题