In the thread titled "Please Read Before Posting a Question" is a section on
the compile log, including headers, and linking libraries that covers the
mechanics of linking libraries.
Note that this is also a section in there in getting started with Glut that
you will also find helpful. It tells you what to get, where to get it, and
where to put it. If you have a library called something.lib, you probably
have the wrong library.
Finally, note that version 4 has been unsupported for about 6 years now.
Despite the "Beta" title, version 5 has been the release branch for many
years.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
good day.
i just installed dev-c++ 4 on a win2k sp4, but when i compile a program using opengl it gives the error:
C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x17):toyok.cpp: undefined reference to
__glutInitWithExit' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x37):toyok.cpp: undefined reference to
__glutCreateWindowWithExit'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x5f):toyok.cpp: undefined reference to
__glutCreateMenuWithExit' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x85):toyok.cpp: undefined reference to
_imp__glClearColor'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x98):toyok.cpp: undefined reference to
_imp__glShadeModel' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0xfd):toyok.cpp: undefined reference to
_imp__glClear'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x108):toyok.cpp: undefined reference to
_imp__glPushMatrix' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x125):toyok.cpp: undefined reference to
_imp__glRotatef'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x13c):toyok.cpp: undefined reference to
_imp__glColor3f' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x153):toyok.cpp: undefined reference to
_imp__glColor3f'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x163):toyok.cpp: undefined reference to
_imp__glBegin' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x189):toyok.cpp: undefined reference to
_imp__glVertex2f'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x1af):toyok.cpp: undefined reference to
_imp__glVertex2f' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x1d5):toyok.cpp: undefined reference to
_imp__glVertex2f'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x1fb):toyok.cpp: undefined reference to
_imp__glVertex2f' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x221):toyok.cpp: undefined reference to
_imp__glVertex2f'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x247):toyok.cpp: more undefined references to
_imp__glVertex2f' follow C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x466):toyok.cpp: undefined reference to
_imp__glEnd'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x46e):toyok.cpp: undefined reference to
_imp__glPopMatrix' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x475):toyok.cpp: undefined reference to
glutSwapBuffers'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x4df):toyok.cpp: undefined reference to
glutPostRedisplay' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x501):toyok.cpp: undefined reference to
_imp__glViewport'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x514):toyok.cpp: undefined reference to
_imp__glMatrixMode' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x51f):toyok.cpp: undefined reference to
_imp__glLoadIdentity'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x542):toyok.cpp: undefined reference to
_imp__glOrtho' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x555):toyok.cpp: undefined reference to
_imp__glMatrixMode'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x560):toyok.cpp: undefined reference to
_imp__glLoadIdentity' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x59f):toyok.cpp: undefined reference to
glutIdleFunc'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x5b4):toyok.cpp: undefined reference to
glutIdleFunc' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x5ec):toyok.cpp: undefined reference to
glutInitDisplayMode'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x601):toyok.cpp: undefined reference to
glutInitWindowSize' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x610):toyok.cpp: undefined reference to
glutInitWindowPosition'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x636):toyok.cpp: undefined reference to
glutDisplayFunc' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x646):toyok.cpp: undefined reference to
glutReshapeFunc'C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x656):toyok.cpp: undefined reference to
glutMouseFunc' C:\DOCUME~1\user1\LOCALS~1\Temp\ccwdcaaa.o(.text+0x65e):toyok.cpp: undefined reference to
glutMainLoop'i already copied the glut32.lib and glut.h into the dev-c++4 library directory and include directory, respectively, of the dev-c++4 directory.
when i compile the sample program using the ms visual c++ it it good.
need help. thanks.
You shouldn't put your files in a path with spaces, but I doubt that's your problem.
Did you link with the library? Those undefined reference errors are what I always get when I forget to add a lib to my linker options.
where do i add lib in linker options??
In the thread titled "Please Read Before Posting a Question" is a section on
the compile log, including headers, and linking libraries that covers the
mechanics of linking libraries.
Note that this is also a section in there in getting started with Glut that
you will also find helpful. It tells you what to get, where to get it, and
where to put it. If you have a library called something.lib, you probably
have the wrong library.
Finally, note that version 4 has been unsupported for about 6 years now.
Despite the "Beta" title, version 5 has been the release branch for many
years.
Wayne
oh ok thanks for the help, i'll check it out now. thanks again.