Using OpenGL with Dev-C++

Installing Visual C++, Linux, or any commercial software is out of the question for me. A few months back, I installed the Dev-C++, GNU C++ compiler for Windows, on my computer. It provided a demo program of rotating triangles which happens to work. However, all the books on OpenGL seem to require GLUT, which I don’t have. The only thing I’ve been able to do so far is change the color of the screen.
I went to the GLUT website and it appears that Visual C++ or Borland C++ are required, or I would have to put on Linux on my machine, none of which I want to do. Could someone help?

I don’t see why it wouldn’t work… just make sure you include the required .lib files.

Go to the Nehe page and follow the link to the Mingw32&Allegro ports.

glut does work with Dev C++, I use it sometimes. I just use the standard version of glut that runs with VC no problems, you do have to change the names of the libs to make them easier to use with Dev C++

Change glut32.lib to libglut32.a

should work fine

Thanks for your help. Even though I still
couldn’t get GLUT to work with Dev-C++, I found a way to get GLUT to work on Windows without using Visual C++, Borland, or any commercial software.

There is a really cool tool called Cygwin, which is a fake Unix. It only has the basic programs tar, gunzip, vim, gcc, g++, etc.
What I did was I went to the Cygwin web page, and used their automatic installation utility and downloaded the Cygwin from the 2nd web site. After the Cygwin installation utility finished its job, I compiled and linked an example program, accum.c by
going to the directory it was in and typed

gcc accum.c -o accum -lopengl32 -lglut32

Make sure that your accum directory is where Cygwin can find it. And if you already have gcc installed on your computer, move the gcc.exe from DJGPP/BIN to DJGPP before using the gcc provided with Cygwin.

I was just about to suggest Cygwin to you. It is a handy little thing to have. (Well, maybe not so little.)

Also, you may be aware of this already, but Borland made their latest compiler available to the public for free. You can download it from their website. It is the compiler that comes with their latest version of C Builder. You don’t get the full IDE, just the command-line tools, but it is fully functional as far as I can tell.

I use Mingw32 (the compiler in Dev-C++) for my pet project and it works great. You should find everything you need at my page or better yet, here:

I prefer Mingw32 to cygwin because it doesn’t
have the overhead of the unix compatibility
DLL, although I think you can use a compiler switch in cygwin to link without it.