PDA

View Full Version : Using OpenGL with Dev-C++



11-25-2000, 04:03 PM
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?

wire
11-25-2000, 05:00 PM
I don't see why it wouldn't work... just make sure you include the required .lib files.

11-25-2000, 05:31 PM
Go to the Nehe page and follow the link to the Mingw32&Allegro ports.

11-25-2000, 10:47 PM
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

11-27-2000, 07:20 AM
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.

Deiussum
11-27-2000, 08:42 AM
I was just about to suggest Cygwin to you. http://www.opengl.org/discussion_boards/ubb/smile.gif 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.

ldglite
11-28-2000, 11:21 AM
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 ldglite.sourceforge.net or better yet, here:
http://sites.netscape.net/zaqhaq/glut.htm

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.