Okay, I’m just trying to build a simple little program, but I keep getting this same error. I also get these same errors everytime I try to compile any openGL .cpp file.
The file below compiles fine, with no errors/warnings, but when I click build (in MSVC++6.0) I get the errors.
Heres the errors (exactly as they appear):
--------------------Configuration: openGL1 - Win32 Debug--------------------
Linking…
glut32.lib : warning LNK4003: invalid library format; library ignored
glut32.lib : warning LNK4003: invalid library format; library ignored
openGL1.obj : error LNK2001: unresolved external symbol _glutMainLoop@0
openGL1.obj : error LNK2001: unresolved external symbol _glutMouseFunc@4
openGL1.obj : error LNK2001: unresolved external symbol _glutReshapeFunc@4
openGL1.obj : error LNK2001: unresolved external symbol _glutDisplayFunc@4
openGL1.obj : error LNK2001: unresolved external symbol _glutCreateWindow@4
openGL1.obj : error LNK2001: unresolved external symbol _glutInitWindowSize@8
openGL1.obj : error LNK2001: unresolved external symbol _glutInitWindowPosition@8
openGL1.obj : error LNK2001: unresolved external symbol _glutInitDisplayMode@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/openGL1.exe : fatal error LNK1120: 9 unresolved externals
Error executing link.exe.openGL1.exe - 10 error(s), 2 warning(s)
Please take a look at my code too, just to make sure that I am doing it right =)
#include <E:/vc98/include/STDAFX.h>
#include <E:/vc98/include/gl/glut.h>bool Init(void);
void Display(void);
void Reshape(int Width, int Height);
void Mouse(int Button, int State, int x, int y);
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmpLine, int nCmdShow) {glutInitDisplayMode(GLUT_RGB|GLUT_DOUBLE);
glutInitWindowPosition(50,50);
glutInitWindowSize(640,480);
glutCreateWindow(“Window Title!”);
Init();
glutDisplayFunc(Display);
glutReshapeFunc(Reshape);
glutMouseFunc(Mouse);
glutMainLoop();
return 0;
}
bool Init(void) {
return true;
}void Display(void) {
}void Reshape(int Width, int Height) {
}void Mouse(int Button, int State, int x, int y) {
}
I’d appreciate any help. =)
P.S. If your gonna try and tell me that the #include directory should be different, you better have a good explanation, cause It works just fine the way it is.