tags:

views:

83

answers:

2

Hey, i was doing an opengl program and it so happens i had to use some functions in the math3d.h header and i copied it to the local directory and included

inlcude "math3d.h"

but i get an error

transform.cpp:(.text+0x3da): undefined reference to `m3dRotationMatrix44(float*, float, float, float, float)' collect2: ld returned 1 exit status

where m3dRotationMatrix44 is a function in math3d

usually i used for glut the switch -lglut SO for this what am i to do? Thanks i advance

+1  A: 

How did you install Math3D?

If you want to do all locally you will also need to copy the library file to your local directory and add it to your link command, ie -lmath3d if the file name is libmath3d.a

If you mean math3d from the OpenGL Super Bible you can try to add the math3d.cpp to your project/makefile

http://andrewtolbert.com/svn/personal/OpenGLSuperBible/shared/math3d.cpp

epatel
Hey can u find out which package actually has math3d?That wud b a big help
yuneek
oh thank you for the help.Let me try it
yuneek
1) Where did you copy it from? 2) Sometime you can see in the header file who wrote it and for what project. http://andrewtolbert.com/svn/personal/OpenGLSuperBible/shared/math3d.h
epatel
Sir i am quite new to linux so what am i supposed to do exactly?i mean with the .ccp file?
yuneek
Ya sir the same thing. i was getting it from superbible
yuneek
It depends. I imagine you have a `makefile`, have you a list of source files in it? add the .ccp there...or...a bad way would be to write an #include "math3d.cpp" in one of your other .cpp file. could work but not recommended
epatel
OK sir. Got it to work. Thanks you so much
yuneek
A: 

When gcc says "undefined reference" it means that you missed one or more libraries to link against. You need to find out what package math3d.h came from and link against the library inside that package.

Ignacio Vazquez-Abrams
Thanks you. Have to see the package that came with it
yuneek