Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8535877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:32:07+00:00 2026-06-11T10:32:07+00:00

I am reading through a Getting Started with OpenGL tutorial and I came across

  • 0

I am reading through a “Getting Started with OpenGL” tutorial and I came across this text:

“If you are using C/C++, then you must first set up a build environment (Visual Studio project, GNU makefile, CMake file, etc) that can link to OpenGL. Under Windows, you need to statically link to a library called OpenGL32.lib (note that you still link to OpenGL32.lib if you’re building a 64-bit executable. The “32” part is meaningless). Visual Studio, and most Windows compilers, come with this library.”

I am just trying to write my source files using vim, I don’t want to use an IDE like VS, and from my understanding the OpenGL libraries come with Windows 7 (correct me if I’m wrong). After this point the article doesn’t really go into any more detail about how to include the OpenGL libraries, and my real question is, how do I include and use the OpenGL libraries in my source files?

Is it as simple as writing #include <name of lib> or do I need to do something else with my Programming environment like editing my path variables?

Edit: I’m using the MinGW g++/gcc compiler

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T10:32:08+00:00Added an answer on June 11, 2026 at 10:32 am

    To get access to the include files, you need a special support library. There are more than one of these, but I would recommend GLEW. You can find the GLEW interface at http://glew.sourceforge.net/.

    The reason for this is that only a very old version of OpenGL headers are available as default on Windows. The newer interface is available indirectly; you have to ask for function addresses. This is however done by GLEW for you.

    So you only have to include < GL/glew.h>, and do some initialization with glewInit();

    This is compatible with both Linux and Windows, especially as you use MinGW. When linking, I use the following:

    MY_LIBS =
    -lglew32
    -lopengl32
    -lWs2_32 -lole32 -lcomctl32 -lgdi32 -lcomdlg32 -luuid

    I can recommend the use of a generic makefile, see http://sourceforge.net/projects/gcmakefile/

    Notice that you also have to setup a context for OpenGL, before initializing GLEW. This is done differently depending on the environment. It is done when you open a window. For portable libraries, I can recommend the glfw library or freeglut.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

At some point through my error my localhost started getting redirected. After reading around
I am currently reading through and working the examples in Getting Started with Grails,
I am just getting started using Spring and am currently reading Spring in Action
I'm just getting started with rails and I'm a little confused reading through different
Reading through this excellent article about safe construction techniques by Brain Goetz, I got
Reading through the Wikipedia article on First-Class functions, there is a nice table of
Was reading through some text and playing around with attempting to write past the
It's clear from reading through threads that I can call a PHP function using
I'm currently reading through this jquery masking plugin to try and understand how it
I have been reading through what seems to be a good tutorial on rest

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.