EDIT: Sorry for the mistake in the Title, it should have been: QT and Visual Studio CRASHING when using GLUT objects?
Hi Guys,
I am working in a task to create a program in OpenGL in Visual Studio with QT framework.
I wanted to learn the first steps in this direction, so I wanted to create a TeaPot just for testing:
[i]#include “glwidget.h”
#include <GL/glut.h>
GLWidget::GLWidget(QWidget *parent)
: QGLWidget(parent)
{
}
void GLWidget::initiliazeGL(){
glClearColor(1, 1, 0, 1);
}
void GLWidget::paintGL(){
glClear(GL_COLOR_BUFFER_BIT);
glutWireTeapot(1.0);
}
void GLWidget::resizeGL(int w, int h){
}[/i]
Above is the class where I put my code. First I have tried to create a Rectangle with GL_TRIANGLES, and it worked, but when I try to add “glutWireTeapot”, or “glutSolidTeapot”, or “glutSolidCube” etc… it crashes the application.
In QT Creator it says:
The program has unexpectedly finished.
C:~//~//~//~~~\debug estBug2.exe crashed
In Visual Studio 2013 it says:
Unhandled exception at 0x000007FEE7C95AAF (freeglut.dll) in testBug2.exe: 0xC0000005: Access violation reading location 0x0000000000000034.
When I saw the message in Visual Studio about the freeglut.dll, I went and deleted the freeglut files, downloaded freeglut again and added the files to the destination folders. But still, it didn’t work
Does anybody have any idea what the problem is?