Originally posted by Swiftwing:
I have coppied the following code from a book:
#include <gl/glut.h>
int main(int argc, char **argv) {
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(320,320);
glutCreateWindow("3D Tech- GLUT Tutorial");
}
It compiles nicely but when I try to link it I get the following errors:
C:\MinGW\bin>g++ -o test test.o
test.o(.text+0x15):test.cpp: undefined reference to `__glutInitWithExit@12'
test.o(.text+0x32):test.cpp: undefined reference to `__glutCreateWindowWithExit@
8'
test.o(.text+0x50):test.cpp: undefined reference to `__glutCreateMenuWithExit@8'
test.o(.text+0xa8):test.cpp: undefined reference to `glutInitDisplayMode@4'
test.o(.text+0xb7):test.cpp: undefined reference to `glutInitWindowPosition@8'
test.o(.text+0xcc):test.cpp: undefined reference to `glutInitWindowSize@8'
What am I doing wrong?
- can it have something to do with me not having the .dll files: opengl32 and gl32? (I have the glut32.dll)
- and if so where do I get them.
thanks