Linker errors when using OpenGL with Bloodshed Dev-C++

All this is deprecated now, use glfw as opposed to glut if you can.

I've read on a few forums that I am not alone in experiencing the linker errors from Bloodshed Dev-C++ when used in conjunction with OpenGL. Once you have correctly installed opengl and copied the dll files into the correct locations you can think about compiling OpenGL applications. There is a test exe here. If the dll is correctly placed in the system directory then you will get a nice graphics card test resembling a clump of broccoli, if not it'll thrown an error like "This application has failed to start because glut32.dll was not found. Re-installing the application may fix the problem." Once the OpenGL dll is installed we can go about installing OpenGL

Installing OpenGL

Already covered extensively online : http://www.opengl.org/wiki/Getting_started is a good place to start.

Resolving the linker errors

Assuming OpenGL is correctly installed, we'll go over what people are doing to encounter the problem to start with. To create a normal Windows app with no OpenGL you would normally go to File -> New -> Project and save a new project choosing an empty project to begin with like this and then saving the project like this. This is where people are becoming unstuck. An OpenGL project needs to be created to start with to avoid the linker errors pictured here If the project is not opened as an OpenGL project to start with you'll get these linker errors regardless of whether you've included the correct libraries or not. Understandably this had a few people stumped. To create an OpenGL project, open the project to start with in the following way. When opening the project, don't open it as an empty project, click Multimedia, and open the project as an OpenGL project like this.
Bloodshed will then start you off with a nice OpenGL test program, which compiles to produce a rotating triangle, but doesn't specify all of the libraries for glut.h to compile correctly.

Don't worry, we're almost there. For glut.h to compile correctly, include the following line at the top of your code :

#define GLUT_DISABLE_ATEXIT_HACK

.. and now include your libraries as normal Project -> Project Options -> Parameters ->
-lopengl32 will already be there from where we started the project as an OpenGL project. Add glut32.lib, libglut32.a, libglaux.a and libglu32.a and all should be good. Or at least it worked for me.

http://www.astahost.com/Installing-Glut-Dev-C-t14192.html contains a lot of useful info on the topic.


Sub

Here you will find some of the projects I have worked on in my spare time.