Advertisement

Wierdest Fix Ever!

Started by May 05, 2001 09:46 PM
3 comments, last by Zipster 23 years, 9 months ago
Heres the code I had:
  
#include < windows.h >
#include < gl\glut.h >

void RenderScene(void)
{
	glClear(GL_COLOR_BUFFER_BIT);

	glFlush();
}

void SetupRC(void)
{
	glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
}

void main(void)
{
	glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
	glutCreateWindow("Simple");
	glutDisplayFunc(RenderScene);

	SetupRC();

	glutMainLoop();
}
  
So I compile it and it''s fine. Then I link it and...AHHH WTF IS THIS?!?!! Some really screwed error, something like this: "glut32.lib: invalid or corrupt file: cannot seek to 0x56d98798e" or similar. Well now thats nothing I can fix, since I have free space and all. So I go online and download the newest version of glut32.lib and WHEW it works....AHHH wait ANOTHER LINK ERROR!!! "Unresolved external symbol: glutCreateWindowWithExit". Now surely that function didn''t exist, as i searched glut.h, glut32.lib, and even glut32.dll! So to see if it''s the glutCreateWindow funciton in my program thats compiling wrong, I comment it out, build the whole thing, and it works, but of course it crahses when it tries to render to a nonexistant window. So I uncomment the glutCreateWindow function. I then decide I should compile it again, just for the hell of it, and... it worked. No unresolved external error warning, just pure blue square!!! Now if I can debug an error just by commenting a line out and then undoing the comment, that''s just sweet.
I''ve run into a couple of things like that; I''m never sure if it''s something wrong with my code, the libraries I''m using, or the compiler... Perhaps it''s a combination of all three that manifest bugs like that

I always add the ''full build'' button to the toolbar, it tends to fix problems like that.

Magmai Kai Holmlor
- The disgruntled & disillusioned
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement
Sometimes I find that changing the name of the function causing the problem to something rediculous, letting it complain about that, then changing it back, fixes the problem for now reason whatsoever.
Simon PriceSi@VBgames.co.ukwww.VBgames.co.uk
Try rebuild all.. it was probably an unbuilt obj causing the problems.
That''s what I began thinking, it was some old object file causing the problem, but an error on a function that didn''t exist in any of the headers or libraries (DLLs too) that I used... ANd it was a glut file, so i knew what files to check...

It''s freaky.

This topic is closed to new replies.

Advertisement