mrDumbass wrote:
i have made an glut-program to represent some data.
What's a "glut-program"?
I would like to use the glut-program in an other program
How do i include the glut-program ?
int main(int argc, char *argv[]) // the main of my glut program
{
glutInit(&argc, argv);
// etc etc
return EXIT_SUCCESS;
}
i would like to use this program in an other source code
like this:
#include "glutProgram.h"
What's in that file, 'glutProgram.h'?
i have made a few attempts but i get alot of these:
[Linker error] undifined reference to 'gluCylinder@36'
etc, etc.
how can i make this work ?
This is not really a C++ language question, but the procedure is
reasonably common, so it might as well be... What you do usually is
create an object file from your source file where the functions live
by compiling it, and then _link_ it in with the other object files to
create the final executable program. That's as much as anybody can
probably tell you while staying off compiler-specific issues.
You need to get a book on using the means available to you in your
compiler or build system to create a program from more than one source
file. And since those things are definitely not defined by C++, you
should consider asking in a newsgroup that deals with your compiler.
V