User forums > Help
Code Blocks Error Message with GLUT
rickg22:
This seems rather interesting. Thomas, perhaps you could do some postings in glut-related forums and present a "Don't use GLUT" or "Use GLFW" initiative? Or at least ask why people don't use glfw...
himaja:
--- Quote from: studiox on October 05, 2005, 01:29:04 am ---
--- Quote from: thomas on October 04, 2005, 11:13:45 pm ---
--- Quote from: studiox on October 02, 2005, 05:55:13 am ---"The dynamic link library glut32.dll could not be found in C:\................................."very long file path which starts with where my cpp file sits and adds all these others weird C:\ paths to it. What is wrong now?
--- End quote ---
That means you have to either copy the dll into the same directory where your program is (happens to be your project folder), or anywhere in your PATH so the system can find it (most people use C:\windows or C:\windows\system32 for that matter).
--- End quote ---
I have copied the DLL to the same directory. Now when i compile and run, i don't but that error anymore, but now it seems to crash. I the the message, my application has generated errors and will be closed by windows, an error report is being created. Whats the deal with that now?
--- End quote ---
Thanks everyone for responding and helping me out. I am now having the "program crashes with a Windows error message" right now - my code is really simple, just a downloaded tutorial to try out GLUT:
#include <gl/glut.h>
void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_TRIANGLES);
glVertex3f(-0.5,-0.5,0.0);
glVertex3f(0.5,0.0,0.0);
glVertex3f(0.0,0.5,0.0);
glEnd();
glFlush();
}
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
glutDisplayFunc(renderScene);
glutMainLoop();
return 0;
}
Also, I have been trying out GLUT because I want to create some simple GUIs for the program I am working on, along with some graphics and 3-D modelling, and GOOGLE suggested GLUT :) I would really appreciate it f anyone can suggest a better package for building Windows, buttons, menus etc.
Thanks,
Himaja.
thomas:
--- Quote from: himaja on October 06, 2005, 07:11:21 am ---[...] building Windows, buttons, menus etc.
--- End quote ---
GLUT does not build any buttons or menus (you can create popup menus, but not a "menu" in the normal sense).
If you want something very similar to GLUT (maybe because you already spent time learning it), you are off best with freeglut (http://freeglut.sourceforge.net).
If you want a really good lightweight OpenGL toolkit, but you don't need popup menus and rather useless geometric modelling functions (like glutWireCube), then GLFW (http://glfw.sourceforge.net) is certainly the best choice.
If you absolutely must have menus and buttons and OpenGL, you will need to use either FLTK (http://www.fltk.org) or wxWidgets (http://www.wxwidgets.org).
wxWidgets has a very nice looking web page and a lot of shining features, but it is an ugly clumsy beast, painful to build and really huge. Also note that wxWidgets breaks STL by redefining new in a macro. If you have the habit to use STL, you must #undef new first (see wxWidgets FAQ).
FLTK looks like crap when you visit their website, but it really does a good job. It is small, lightweight, and easy to program with. There is a RAD editor coming with it, too. The 1.1x branch is 'stable', and 2.0 is 'alpha'. Building is nearly as painful as building wxWidgets, but there are binary DevPaks ;)
If you want to create windows, buttons, and menus inside your OpenGL context, you might want to look at GLUI (http://www.nigels.com/glt/glui) or at Crazy Eddie's GUI. The latter was still quite awful when I last looked at it a year or so ago, but it now ships with OGRE, so I guess that it has been drastically improved.
EDIT:
The code above looks like it should work. There is only one mistake in it, but that cannot possibly cause a crash. You forgot to set a vertex colour, so it would probably render all black. Are you maybe using some weird optimisation options (regparam comes to my mind), and have you made sure you use pristine versions of the GLUT library files? Maybe you experience DLL hell?
himaja:
--- Quote from: thomas on October 06, 2005, 01:14:45 pm ---
--- End quote ---
Thank you for all the info about the various toolkits :) I decided to give up on GLUT (since it is still crashing without showing any output - anyone know a solution to that????) and go with WxWidgets instead. glut DOES seem to be DLL hell, overall. I am an experienced PROGRESS developer trying to get a software completed in C++, and I must say that Code::Blocks is a really great tool to use. And this forum is a godsend!!! Thank you, everyone, for helping out.
Himaja.
petsagouris:
I know I am digging an old thread (dead even), but I wanted to post some corrections to the procedure for setting up ol'n'dead GLUT on Code::Blocks and MinGW.
Follow through the tutorial on the Lawrence Goetz page. Before you try compiling the test project edit the following
in glut.h
on line 10 change
--- Code: ---# if 0
--- End code ---
to
--- Code: ---# if (_WIN_ALL)
--- End code ---
Then go in the Project -> Build Options... ->#defines and add : _WIN_ALL
This should correct the error: redeclaration of C++ built-in type `short'
on line 100 add
--- Code: ---#define GLUT_DISABLE_ATEXIT_HACK
--- End code ---
This should correct the warning: 'int glutCreateMenu_ATEXIT_HACK(void (*)(int))' defined but not used
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version