Jump to content
  • Advertisement
Sign in to follow this  
amp47

OpenGL a problem with opengl and glfw

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

i am a new on opengl and following a tutorials but at this poient get stuck and this error show i don't know what can i do to solve it

this

 

E:\**********CppProjects\glew-1.11.0-win32_3\glew-1.11.0\lib\Release\Win32\glew32s.lib(tmp\glew_static\Release\Win32\glew.obj):(.text$mn+0x7)||undefined reference to `_imp__wglGetProcAddress@4'|

please i need to know that cause this problem 

Share this post


Link to post
Share on other sites
Advertisement

Undefined reference error means that the linker can't find the definition of a function. Seems like you are missing opengl32.lib from the linker settings.

Edited by Sponji

Share this post


Link to post
Share on other sites

thanks for reply  iam using this on linker>>other options

-lglew32 -lopengl32 -glfw32 -lglu32

Share this post


Link to post
Share on other sites

i have tried that but its still show the error

||=== Clean: Debug in cgame (compiler: GNU GCC Compiler) ===|
||=== Build: Debug in cgame (compiler: GNU GCC Compiler) ===|
E:\CppProjects\cgame\GameWindow.h||In constructor 'GameWindow::GameWindow(bool)':|
E:\CppProjects\cgame\GameWindow.h|17|warning: 'GameWindow::_window' will be initialized after [-Wreorder]|
E:\CppProjects\cgame\GameWindow.h|14|warning:   'RenderEngine* GameWindow::_render' [-Wreorder]|
E:\CppProjects\cgame\GameWindow.cpp|14|warning:   when initialized here [-Wreorder]|
E:\CppProjects\cgame\RenderEngine.cpp|39|warning: 'renderEngine' is used uninitialized in this function [-Wuninitialized]|
||Warning: .drectve `/DEFAULTLIB:"LIBCMT" /DEFAULTLIB:"OLDNAMES" ' unrecognized|
E:\CppProjects\glew-1.11.0-win32_3\glew-1.11.0\lib\Release\Win32\glew32s.lib(tmp\glew_static\Release\Win32\glew.obj):(.text$mn+0x7)||undefined reference to `_imp__wglGetProcAddress@4'|
E:\CppProjects\glew-1.11.0-win32_3\glew-1.11.0\lib\Release\Win32\glew32s.lib(tmp\glew_static\Release\Win32\glew.obj):(.text$mn+0x4)||undefined reference to `_imp__wglGetProcAddress@4'|
||=== Build failed: 2 error(s), 5 warning(s) (0 minute(s), 4 second(s)) ===|
 

i am using

this includes :

#define GLFW_INCLUDE_GLU
#define GLEW_STATIC
#include <GL/glew.h>
#include <GL/glfw3.h>
#include "VertexBuffer.h"
#include "ShaderInterface.h"
#include <vector>
#include <iostream>

Share this post


Link to post
Share on other sites

Put -lopengl32 last, not first, because the linker does not know other libraries depend on it before having worked on these.

Also it would be better to not use glu, its outdated and there are better ways of setting the projection and getting mipmaps made.

And you should order the constructor initializer list in the same way as the class members, fix the bug with the access to the uninitialized variable and fix the setting thats not recognized.

Share this post


Link to post
Share on other sites

Put -lopengl32 last, not first, because the linker does not know other libraries depend on it before having worked on these.

Also it would be better to not use glu, its outdated and there are better ways of setting the projection and getting mipmaps made.

And you should order the constructor initializer list in the same way as the class members, fix the bug with the access to the uninitialized variable and fix the setting thats not recognized.

thanks ill try that

Share this post


Link to post
Share on other sites
Of course you have #include <GL/glew.h> before anything else right?
If so and it still doesnt work try putting #define GLEW_STATIC before that

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!