I am coding in code blocks and I created a c++ script that uses openGL. Running the code from codeblocks works perfectly but going into the bin file and running the exe directly spits back the error The code execution cannot proceed because libfreeglut.dll was not found here is the code
#include <GL/glut.h>
#include <iostream>
using namespace std;
GLfloat controller = 0.01;
GLfloat change = 0.01;
void Change(int);
void displayMe(void)
{
glClear(GL_COLOR_BUFFER_BIT);
glBegin(GL_POLYGON);
glVertex2f(-0.6 + controller,-0.6 + controller);
glVertex2f(0,-1);
glVertex2f(-1,-1);
glVertex2f(-1,0);
glEnd();
glBegin(GL_POLYGON);
glVertex2f(0.6 - controller,0.6 - controller);
glVertex2f(0,1);
glVertex2f(1,1);
glVertex2f(1,0);
glEnd();
glutSwapBuffers();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_DOUBLE);
glutInitWindowSize(700, 700);
glutInitWindowPosition(100, 100);
glutCreateWindow("SAMPLE TEST");
glutDisplayFunc(displayMe);
glutTimerFunc(0,Change,0);
glutMainLoop();
return 0;
}
void Change(int a) {
controller = controller + change;
if(controller > 0.6) {
change = -0.01;
}
if(controller < -0.6) {
change = 0.01;
}
glutPostRedisplay();
glutTimerFunc(15,Change,0);
}
I was expecting the exe to run the code normally so I cud send it to other computers