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 8166437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:51:48+00:00 2026-06-06T19:51:48+00:00

The problem is in the title, I’ll try to list what I’ve already tried

  • 0

The problem is in the title, I’ll try to list what I’ve already tried and so on below.

First off, in my understanding, in order to use OpenGL 4.0 on windows you must extend and or bypass the default windows library as it only ships OpenGL 1.1.

So we have MinGW installed at C:/MinGW/. Next I setup FreeGLUT by downloading the tarball from the project site. Extract and compile by running the makefiles according to the instructions with a minor addition of --prefix to the ./configure command.

./configure --prefix=/c/Users/Owner/root/
make all
make install 

Now I have freeglut in /c/Users/Owner/root/lib/, /c/Users/Owner/root/include/ and so on. Next up is GLEW, my problem child as far as I can tell.

Download the source archive from the project site (direct 1.7.0.zip link). Compiling is a tad more complicated, my current recipe is derived from the stack overflow question ” Building glew on windows with mingw “. An abbreviated form is listed below:

mkdir lib/
mkdir bin/
gcc -DGLEW_NO_GLU -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32.dll -Wl,--out-implib,lib/libglew32.dll.a -o lib/glew32.dll src/glew.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32.a src/glew.o
gcc -DGLEW_NO_GLU -DGLEW_MX -O2 -Wall -W -Iinclude -DGLEW_BUILD -o src/glew.mx.o -c src/glew.c
gcc -shared -Wl,-soname,libglew32mx.dll -Wl,--out-implib,lib/libglew32mx.dll.a -o lib/glew32mx.dll src/glew.mx.o -L/mingw/lib -lglu32 -lopengl32 -lgdi32 -luser32 -lkernel32
ar cr lib/libglew32mx.a src/glew.mx.o

and should be run from the “root” of /path/to/glew-1.7.0/.


Now with setup of libraries “done” (assuming no mistakes… ) compiling my simple program is done with this line.

${G++}  -DFREEGLUT_STATIC -DGLEW_STATIC -m32 main.cpp -o main.exe -lfreeglut_static -lopengl32 -lwinmm -lgdi32 -lglew32  -I ${ROOTPATH}/include -L ${ROOTPATH}/lib --static

Now to decompose this a bit and walk through why I have various “extra” arguments and to show you what errors and problems I’ve already run into and solved.

  1. -DFREEGLUT_STATIC and -lfreeglut_static are used instead of the normal -lfreeglut as we want a static build here. Failure to do this gives linker errors relating to freeglut.
  2. -DGLEW_STATIC is added for the same reason.
  3. -lwinmm is added to fix the linker error: freeglut_init.c:(.text+0x5d9): undefined reference to '_timeBeginPeriod@4'.
  4. -lgdi32 is added to fix the linker error: c:/Users/Owner/root//lib\libfreeglut_static.a(freeglut_init.o):freeglut_init.c:(.text+0x58c): undefined reference to '_GetDeviceCaps@8'

Now I’m stumped with the following linker error:

c:/Users/Owner/root//lib\libglew32.a(glew.o):glew.c:(.text+0x83e8): undefined reference to `_glGetString@4'
c:/Users/Owner/root//lib\libglew32.a(glew.o):glew.c:(.text+0xa1b2): undefined reference to `_glGetString@4'
c:/Users/Owner/root//lib\libglew32.a(glew.o):glew.c:(.text+0xa290): undefined reference to `_glGetString@4'

The minimal test case that produces this error (main.cpp) is.

#include <GL/glew.h>
#include <GL/freeglut.h>

int main(int argc, char **argv) {
  glEnableVertexAttribArray(0);
}

Ideas?

  • 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-06T19:51:51+00:00Added an answer on June 6, 2026 at 7:51 pm

    Try adding -lopengl32 last on the line to compile your program and see if it helps.

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

Sidebar

Related Questions

Ok title is confusing, Ill tell you my problem first: the polymorphic_url method was
I have tried to precisely explain my problem in the title itself. Can I
The problem is as the title says: First: two equality symbols in one statement.
I have problem removing this title bar/image: I've tried theme change in manifest file
Problem is in title. My html: <div id=myCarousel class=carousel> <div class=carousel-inner> <div class=active item><%=
I've problem like in title. I'm using ruby with Sinatra framework and trying to
i have a problem just as title, and the http-status is 302 Moved Temporarily.
I am writing a class. I have encountered the problem in the title. Here
The title might not explain my problem fully but I wasn't sure how to
The title of the question pretty much states the problem. Is it possible?

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.