Code::Blocks Forums

User forums => Help => Topic started by: theeil on March 29, 2005, 06:13:34 am

Title: Undefined References when compiling/linking an openGLaopengl
Post by: theeil on March 29, 2005, 06:13:34 am
I just downloaded the new version of c::b and it looks like it is good but I ran into one problem i had not found before in codeblocks or devc++ (all other copmpilers: vc98, vc 2003, borland 5.5... have this problem). I get the error:

undefined reference to '[opengl function]@[number]'

for example: undefined reference to 'glOrtho@48'

and beta 3 compiled the same code with the same minGW install. one more thing: when i was using glut, vc2003 worked! I don't have a clue what is going on, if anyone can help me out with this one, that would be great! thanks.
Title: Undefined References when compiling/linking an openGLaopengl
Post by: mandrav on March 29, 2005, 08:57:16 am
Have you linked to opengl???
Title: Undefined References when compiling/linking an openGLaopengl
Post by: Anonymous on April 13, 2005, 04:12:33 pm
It usally eazy to fix undefined reference error.  What your problem is you are missing a libbary file with the fuction you need in it.  Go Bring up your file search program and look for anything that contans text of the missing futtion.  This would be your 'glOrtho@48'  in your example.  Also put *.a for Filename you are searching for if using mingw or *.lib vc++.   It will then give you a list of libarry wich have the fuction mention pick the name of the libbary and add it to be link in with your program.    

Ps on microsoft xp i had to enable Index seach and change some option so it search for text inside all files.