Build errors w/ GLee (GL Easy Extension Library) - c++

Using Code::Blocks w/ mingw, and trying to use GLee for some OpenGL on windows. I'm getting the following build errors:
GLee.c|60|undefined reference to `_wglGetProcAddress#4'
GLee.c|10748|undefined reference to `_wglGetProcAddress#4'
GLee.c|10751|undefined reference to `_wglGetCurrentDC#0'
GLee.c|10797|undefined reference to `_glGetString#4'
GLee.c|10910|undefined reference to `_glGetString#4'
GLee.c|10976|undefined reference to `_glGetString#4'
And I'm just including GLee likes so (with GLee.c, not the .dll):
#include "GLee.h"
According to Ben Woodhouse, GLee is "written in pure ANSI C, so any C or C++ compiler should work. You can include the source files in your projects directly or compile them into a library", so I should be having no problems.
Google didn't give me much on this, so I'm hoping some OpenGL vets (or anyone familiar with GLee) out there can point me in the right direction.

It looks like you need to link your application against the OpenGL libraries (specifically Opengl32.lib) which will provide the functions that you are missing. Perhaps the OpenGL FAQ might be of help in figuring this out.

Related

Not able to compile Realsense c++ project

I am trying to compile a project to control the R200 Realsense camera. I have ported all necessary Realsense libraries to a local project (see linked picture) but when I try to build this c++ project I get several errors. I am sure the errors come because problems including the rs.h library (also local) but I cannot solve it :(
As I said, all code files are local and under the same folder:
main.cpp
rs.h
rs.hpp
rscore.hpp
rsutil.h
Here, as an example, one the errors I am getting. The other errors are similar but referring to other functions, all of them under rs.h
/home/xxx/Documents/Realsense/R200/rsutil.h:85: undefined reference to 'rs_set_device_options'
Can anyone give me a hint how to been able to make 'rs.h' available to the rest of the code?
Many thanks in advance

How do I get MinGW to accept DirectX 11?

After attempting the solutions here and here, I got Eclipse to the point where it doesn't give me a bunch of errors while I'm writing my DX11 application. The linker on the other hand, continues to give me some undefined reference errors. Right now, it's just for IID_IDXGIFactory and CreateDXGIFactory simply because I haven't finished the Initialize() function and there's no other part of the code that uses the DirectX API.
What am I missing that is causing these errors in the linker?
Edit: Libraries included are the x64 versions of dxgi, dxguid, d3d10, d3dx10, d3d11 and d3dx11 in that order. I already know that not linking to the correct libraries causes undefined reference errors. My question is, what am I missing?

using freeglut instead of GLUT

I am learning OpenGL with the help of tutorials found online. Many of them use GLUT library, even though it is generally recommended to use freeglut instead. How will replacing GLUT header file with freeglut header affect the compilation ? Is such a simple replacement possible ? Are there many differences in terms of syntax, function names and usage ?
As mentioned by Andon, replacing the header will do next to nothing. The FreeGLUT about page has a good description of the what and why (http://freeglut.sourceforge.net/index.php).
Why not to use GLUT, from the above link:
The original GLUT library seems to have been abandoned with the most
recent version (3.7) dating back to August 1998. Its license does not
allow anyone to distribute modified library code. This would be OK, if
not for the fact that GLUT is getting old and really needs
improvement. Also, GLUT's license is incompatible with some software
distributions (e.g., XFree86).
As for the syntax and function names, if your code currently compiles fine with GLUT, it should compile fine with FreeGLUT. You may need to tell the compiler to use/link against FreeGLUT instead of GLUT (and where to find it).
A quick Google search produced this result (using FreeGLUT), might be useful... http://peon-developments.blogspot.com.au/2011/04/creating-opengl-window-with-freeglut-in.html

undefined reference to glCompressedTexImage2D

I am trying to load some .dds textures for my game.
My IDE is Dev-C++ with GLUT 7.6 installed.
When I use OpenGL functions like glTexImage2D() or glVertex2f() my programs compile normally but when I try any of the glCompressedTexImage functions the linker tells me that there's an undefined reference to it.
like that: [Linker error] undefined reference to `glCompressedTexImage2D#32'.
I am linking my project only with libopengl32.a, and I am using Win API for the window.
Does I need to add another library in the linker options or my OpenGL version is too old ?
On windows platform opengl32.lib provides functions only for a very old GL version (1.1 or something like that). If you want functionality from newer OpenGL version, then you should get pointers to missing functions using wglGetProcAddress.
However, this is too much hassle. So instead of that you can use OpenGL extension library (GLEW or GLEE) to get missing function addresses for you. It is a better idea to use GLEW instead of GLEE, since GLEE looks abandoned.

GLEW Linker Error

I am following along with tutorials on the site, http://openglbook.com/, and I have run into a problem I cannot solve. In the second tutorial, they begin using shaders. After entering in their code, I get linking errors such as,
"[Linker error] undefined reference to '_ imp____glewGenVertexArrarys'"
as well as a lot of others. My development environment is Dev-C++. I have linked against glew32.lib, but it still fails to recognize some of the GLEW functions. I have been able to utilize some functions from the GLEW library, but when it comes to these shaders, something is going wrong and I cannot figure out why. Any help would be much appreciated.
I recently had a similar problem with glew and VS 2010.
I can't remember the link that said it but I think they talked about statically linking glew by defining the makro GLEW_STATIC.
Btw for me the solution was to recompile GLEW from source on my own.
EDIT
I think I found the link: http://www.gamedev.net/topic/462433-glew-and-mingw/