Skip to main content
GameDev.net gamedev.net
🔒 Locked

Link errors

Started by peter86 Feb 19, 2003 at 1:39 PM 7 replies 5k views
Original Post
peter86
peter86
I''m getting: GlutMain.obj : error LNK2001: unresolved external symbol ___glutInitWithExit@12 GlutMain.obj : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8 What''s wrong?
programering
programering
I have also problem with linking.

Anton Karlsson
Klingis Entertainment
Games with silly humor
programering
programering
Does a missing .lib file cause linking errors?

What does the linker mean with unresolved external symbol?

Anton Karlsson
Klingis Entertainment
Games with silly humor
Teodric
Teodric
quote:

Does a missing .lib file cause linking errors?



Yes. A linker links lib and object files. If one is missing, that''s a linker error.

quote:

What does the linker mean with unresolved external symbol?



It means a symbol used in one of the modules (lib or obj files) isn''t found in any file used in the linking process. There''s some code using for instance "printf", but no library containing the compiled code for it.

hth,

(My projects and ramblings...)
peter86
peter86
quote:
Original post by Anonymous Poster
#pragma comment(lib, "glut32.lib") underneath the includes. I THINK the filename is glut32.lib, but I''m not 100% sure on that since I don''t use GLUT.


No, it''s not that I''ve already linked glut32.lib. It must be something else, but what?
Teodric
Teodric
quote:

GlutMain.obj : error LNK2001: unresolved external symbol ___glutInitWithExit@12
GlutMain.obj : error LNK2001: unresolved external symbol ___glutCreateWindowWithExit@8



Question: A quick search makes me believe there''s something about those two functions - I can''t find mention of them anywhere, except a few people who also had trouble with linking them (none got a reply though). The glut API docs at http://www.opengl.org/developers/documentation/glut/spec3/spec3.html does not include those functions.

So, what are they? Where did you find them?

(My projects and ramblings...)
etaylor27
etaylor27
I had a similar (perhaps identical) error message earlier tonight while trying to get a glut app running in Dev-C++. The error was in fact corrected by linking the proper glut library. I think I was at first linking glut rather than glut32, but now as I try to retrace my steps to repeat the error so I can make sure what I''m telling you is accurate, I can''t seem to get that error anymore. I hope this helps at all.

Elijah
--"The greatest pleasure in life is in doing what people say you cannot do." -- Walter Bageholt
Brother Bob
Brother Bob
I don''t know what these function really do, but some versions of GLUT seems to replace glutInit with glutInitWithExit (same for CreateWindow). To disable this, put a #define GLUT_DISABLE_ATEXIT_HACK before including GL/glut.h. Not 100% sure about the name of the define though.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.