0

I'm using "i686-w64-mingw32" and trying to link to GLEW.

Here is a test main.c I am using:

#define GLEW_STATIC
#include <gl/glew.h>

int main() {
    glewInit();
    return 0;
}

(I know that this is not the correct way to use GLEW since I haven't correctly initialised and binded an OpenGL context - I'm just trying to get GLEW to link correctly and I'll worry about using it correctly later.)

The line I am using to compile is:

gcc main.c -o bin.exe -lglew32s -lglu32 -lopengl32

However I receive this error:

main.c:(.text+0xc): undefined reference to `glewInit@0'
collect2.exe: error: ld returned 1 exit status
Jimmay
  • 959
  • 3
  • 13
  • 27
  • Couldn't find a fix from that link. I appear to have linked in the correct order, and I'm not at all associated with C++. Thanks anyway. – Jimmay Jul 16 '14 at 20:37
  • 1
    This isn't a duplicate. The OP does not want to know what an undefined reference error is, but rather why they are getting one after linking to what seems to be the correct library. – fintelia Jul 16 '14 at 23:18
  • File names are case sensitive on Linux. The name of the normal GLEW library file is libGLEW.so thus you would link to it with `-lGLEW`. I imagine that that static version (if it exists on Linux, are you sure it does?) would be named similarly. – fintelia Jul 16 '14 at 23:28

0 Answers0