News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

undefined references

Started by Newb, February 21, 2005, 07:22:23 AM

Previous topic - Next topic

Newb

I am trying to use the glut library for openGL development. I am using the MinGW compiler with code blocks and I am getting constant undefined reference errors what might be causing this could it be a missing library or source file possibly a dll. (yes I am trying to use windows with this, I am so ashamed...)  Any help will be greatly appreciated!

rz950

Do you have the all the -lglu because you could have the lib but without adding into the linking commands that opengl stuff it wil not work. If you go to projects in c::b there is a opengl temeplate use that one and get it working for what you need (just add the glut headers; if it doesn't use them already)

xerop

Ok the problem is in the linker but how do I get the options from the project file (*.cbs) to show up in codeblocks when I attempt to configure the compiler (MINGW). None show up yet there are a lot of them in the project file (I checked with notepad).

By options I mean linker arguments

rickg22

In "Project..." select "Properties", "targets" tab, "target's build options" button, "linker options" tab. Add the -lglu to the options. If it still doesn't link, perhaps you need to add the directory of the library to the "Linker's DIRS" tab.

xerop

I found a way to link it but the options don't show up in the project file, why don't they?

xerop

never mid I found why it doesn't save in the project file i saved the source not the project.  :oops:  doh! However I do hav another question how do you know what you want the linker to link to if you have an unrelated library like glut.  I know when I got the library it a file by libglut32.a  <- that  name is this the file I link to and what kind of an option would i give the linker?

Thank you very much for treating a newbie so nicely I will repay you or someone else with the same generasity someday when I know enough.
THANK YOU!!!

rz950

libgult32 would be -lglut32