Jump to content
  • Advertisement
Sign in to follow this  
parvaneh

OpenGL openGL confusing error

This topic is 4023 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I will be very thankfull if someone helps me I have written a code and used some functions but i face the following errors in microsoft visual C++ I have used these functions: tkExposeFunc(expose); tkReshapeFunc(reshape); tkDisplayFunc(draw); tkExec(); I have included these headers into my source code : #include "stdafx.h" #include <stdlib.h> #include <stdio.h> #include <windows.h> #include <glu.h> #include <glut.h> #include <glaux.h> #include <math.h> and i face these errors : DigitRendering.obj : error LNK2001: unresolved external symbol _tkExec DigitRendering.obj : error LNK2001: unresolved external symbol _tkDisplayFunc DigitRendering.obj : error LNK2001: unresolved external symbol _tkReshapeFunc DigitRendering.obj : error LNK2001: unresolved external symbol _tkExposeFunc DigitRendering.obj : error LNK2001: unresolved external symbol _tkQuit DigitRendering.obj : error LNK2001: unresolved external symbol _tkInitWindow what should I do?

Share this post


Link to post
Share on other sites
Advertisement
It is not an OpenGL error as those are not OpenGL functions. You need to link with whatever library the tk* functions live in.

Share this post


Link to post
Share on other sites
These functions are included in gltk.h

extern void tkExec(void);
extern void tkExposeFunc(void (*)(int, int));
extern void tkReshapeFunc(void (*)(int, int));
extern void tkDisplayFunc(void (*)(void));
extern void tkKeyDownFunc(GLenum (*)(int, GLenum));
extern void tkMouseDownFunc(GLenum (*)(int, int, GLenum));
extern void tkMouseUpFunc(GLenum (*)(int, int, GLenum));
extern void tkMouseMoveFunc(GLenum (*)(int, int, GLenum));
extern void tkIdleFunc(void (*)(void));



why this happens?

Share this post


Link to post
Share on other sites
The library in question is probably gltk, an OpenGL interface for Tk. You have likely been trying to compile someone's tutorial code, but you do not have gltk installed (ie, like the poster above said, you need to link your object code to gltk.o or gltk.lib or whatever it's called. Just having the header file is not enough). Replace the gltk specific code with normal windowing code or with glut, and you'll be okay.

Share this post


Link to post
Share on other sites
I don't know if it's better to use glut, just saying that it's an alternative if you can't get this gltk thing to work (it doesn't seem to be very popular, I could barely find anything about it). You can also use none of them and just write window code in the operating system's sdk, since my understanding is that glut and gltk basically just wrap window creation code and such.

Share this post


Link to post
Share on other sites
You said that those functions come from gltk.h but you haven't included that at the top. Try including it and it should go away.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!