I’m using Visual studio c++ 2010. My program was working fine until I linked in box2d and now this error comes up.
error LNK2019: unresolved external symbol _glutMainLoop@0 referenced in function _main
I haven’t even included box2d, just linked
So I linked in the glut32.lib file and then I get an error saying that the glut32.dll file doesn’t exist but I can quite clearly see that it does exist in my system32 folder.
Am I missing something? This is driving me nuts.
If I remove the link to box2d, glut and gl start working again.
here’s the code – nothing special.
#include <GL/glut.h>
#include "Sprite.h"
#include "RLBitmap.h"
#define windowWidth 800
#define windowHeight 600
void display(){
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
void init(){
}
int main(int argc,char** argv){
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowSize(windowWidth, windowHeight);
glutCreateWindow("Bitmap Demo");
glClearColor(0.0, 0.0, 0.0, 0.0);
gluOrtho2D(0, windowWidth, 0, windowHeight);
init();
glutDisplayFunc(display);
glutMainLoop();
return 0;
}
The simplest way to tackle this is to put the DLL files in the same directory as your executable. That ensures that the versions that are loaded are exactly the versions you want
The situation you describe, DLL files present in system32 but not found, is most likely because your app is 32 bit and so looks in the 32 bit system32 folder which is named SysWOW64.