Tutorial: set up glew and freeglut under dev-c++

hi all.
i finally figured out how to install the newest glew and freeglut under dev-c++. it is very easy.
before installing glew and freeglut, download the newest driver for your video card for the newest opengl support.

  1. go to http://www.bloodshed.net/dev/devcpp.html and download Dev-C++ 5.0 beta 9.2 (4.9.9.2) with Mingw/GCC 3.4.2 (i couldnt get it to work with the new version and the 64 bit compiler); this is the version that works for me.
  2. install it.
  3. go to tools check for updates/packages.
  4. choose devpaks.org for the server.
  5. hit check for updates.
  6. scroll through until you find freeglut, select it. the glew package doesnt work and is outdated so dont select it.
  7. hit download selected.
  8. now freeglut should work.
  9. to get the newest glew go to The OpenGL Extension Wrangler Library - Browse /glew/1.9.0 at SourceForge.net and download glew-1.9.0-win32.zip.
  10. open the glew-1.9.0 folder in the zip file and paste all its contents into the dev-c++ main directory.
  11. then copy the glew32.dll file in the bin folder to your %systemroot% (this directory changes based on what version of windows you’re using, for windows 7 its “Windows”). to find your systemroot press “windows key + r” then type
    “set systemroot” (no parenthesis).
    your system is now setup.

some more info.
to test out the source code at the bottom of this page:
restart dev-c++ and open a new project click on the multimedia tab and there should be a freeglut option click it.
you will new to add a linker option for glew so go to the project tab, then project options. go to the parameters tab and under linker you shoud see a whole bunch of “words” starting with -l and seperated by spaces. all of the options in the linker column are necessary to run freeglut; these are:-lfreeglut -lglu32 -lopengl32 -lwinmm -lgdi32 you need to add the linker for the glew library; which is: -lglew32.

copy this code into your project and compile and run. if it works you will see a white fully working screen. if glew fails, im not sure what happens, but, you wont see a fully working white screen. if you get a comile error you done something wrong. if you’re error says “undefined reference to” youre missing one or more linkers. if not you either misspelled the linker or something went wrong with your installation.

#include <GL/glew.h>
#include <GL/freeglut.h>
#include <cstdio>

int main(int argc, char **argv) {
    
    glutInit(&argc, argv);
    glutInitWindowSize(640,480);
    glutInitWindowPosition(10,10);
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
   
    glutCreateWindow("Blah");
   
    GLenum err = glewInit();
    if (err == GLEW_OK) {
       glutMainLoop();        
    }
    
    // if GLEW is found, the program will show a "dirty" window.
    // if not, the window will only be shown only for a split second.
    
    return 0;
    
}

the opengl linker option is: -lopengl32 by the way.

good luck getting started!

Why you shouldn’t use Dev-C++

Do you think it’s good enough for learning?

Absolutely no way.

You need an IDE and compiler that’s reasonably free of bugs so that if something weird does happen you can be certain that it’s your own code and not an IDE/compiler bug. This is even more crucial when learning, and Dev-C++ is not that IDE.

There are plenty of excellent alternatives on the page I linked all of which are up to date, maintained and will have bugs fixed going forward. None of that applies to Dev-C++.

To quote from the page I linked:

you are very probably hampering your learning and development efforts if you continue to use it

Does that sound like “good enough for learning” to you?

I can’t make a recommendation of one because I don’t know which circumstances apply best to you, so look at that page again and pick the one that seems to suit best.

[QUOTE=mhagain;1251602]Absolutely no way.

You need an IDE and compiler that’s reasonably free of bugs so that if something weird does happen you can be certain that it’s your own code and not an IDE/compiler bug. This is even more crucial when learning, and Dev-C++ is not that IDE.

There are plenty of excellent alternatives on the page I linked all of which are up to date, maintained and will have bugs fixed going forward. None of that applies to Dev-C++.

To quote from the page I linked:

Does that sound like “good enough for learning” to you?

I can’t make a recommendation of one because I don’t know which circumstances apply best to you, so look at that page again and pick the one that seems to suit best.[/QUOTE]

wow i didnt know visual studio was free! kk thanks