OpenGL Linking to GLEW [just never mind.]

This topic is 3548 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I've looked for literally hours for a way to statically link GLEW. Some say "You have to define GLEW_BUILD as GLEW_STATIC". Others say "You have to define static so it knows you're building an exe" One even gave instructions on linking to the GLEW DLL. Everyone else is talking about XCode for Apple. None of these things apply to me. I don't want a DLL, and I already have the official static lib, I believe. There's a GLEW binary release at glew.sourceforge.net that comes with the static lib. It's named glew32s.a. However, when I link to it, it's just as good as linking to nothing at all; any function I call from GLEW screams undefined reference. The other library included is just glew32.a, which is smaller because it instead links to a DLL, which as I said, I don't want to do. Am I wrong about glew32s.a? Am I misunderstanding, and you're only supposed to use the C file they give you? I compiled it as an object file with GLEW_STATIC defined. ------------------------------------------ -L"C:/Dev-Cpp/lib" -mwindows -lopengl32 "C:/Dev-Cpp/include/zlib/libzlib.a" C:/Dev-Cpp/include/GL/glew.o C:/Dev-Cpp/include/GL/glew.o(.bss+0xe18):glew.c: multiple definition of __glewBindFramebufferEXT' Graphics_Systems/OpenGL/GSsurface.o(.bss+0x0):GSsurface.cpp: first defined here C:/Dev-Cpp/include/GL/glew.o(.bss+0xe34):glew.c: multiple definition of __glewFramebufferTexture2DEXT' Graphics_Systems/OpenGL/GSsurface.o(.bss+0x8):GSsurface.cpp: first defined here C:/Dev-Cpp/include/GL/glew.o(.bss+0xe3c):glew.c: multiple definition of __glewGenFramebuffersEXT' Graphics_Systems/OpenGL/GSsurface.o(.bss+0x4):GSsurface.cpp: first defined here SHELLmain.o(.text+0x72):SHELLmain.cpp: undefined reference to _imp__glewInit' SHELLmain.o(.text+0x16b):SHELLmain.cpp: undefined reference to _imp__wglewIsSupported' C:/Dev-Cpp/include/GL/glew.o(.text+0x389):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x3bd):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x3f1):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x425):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x469):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x49d):glew.c: more undefined references to wglGetProcAddress@4' follow C:/Dev-Cpp/include/GL/glew.o(.text+0x13925):glew.c: undefined reference to glGetString@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x139c1):glew.c: undefined reference to glGetString@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x16504):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x16548):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x1657c):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x165b0):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x165e4):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x16628):glew.c: more undefined references to wglGetProcAddress@4' follow C:/Dev-Cpp/include/GL/glew.o(.text+0x17a19):glew.c: undefined reference to wglGetCurrentDC@0' C:/Dev-Cpp/include/GL/glew.o(.text+0x17abf):glew.c: undefined reference to wglGetProcAddress@4' C:/Dev-Cpp/include/GL/glew.o(.text+0x17ad3):glew.c: undefined reference to wglGetProcAddress@4' collect2: ld returned 1 exit status make.exe: *** [test.exe] Error 1 Execution terminated ---------------------------------------- I then compiled with GLEW_BUILD defined as GLEW_STATIC. 100 KB bigger, identical errors. I'm out of ideas. Help greatly appreciated. [Edited by - Josh@Dreamland on January 7, 2009 3:38:48 PM]

Share on other sites
Have you tried compiling it with a version of GCC that isn't ancient? Go get yourself a copy of Code::Blocks bundled with MinGW and see if that helps. Dev-C++ is a dead project. Just keep in mind that the current version of MinGW crashes on throw.

Share on other sites
Just tried Code::Blocks. Does the same thing. =
Forget it. I'm switching to GLee. Thank you for the help anyway.

[Edited by - Josh@Dreamland on January 6, 2009 6:19:36 PM]

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 10
• 23
• 9
• 32
• Forum Statistics

• Total Topics
632630
• Total Posts
3007525
• Who's Online (See full list)

There are no registered users currently online

×