Menu

undefined reference

moj
2007-10-08
2012-09-26
  • moj

    moj - 2007-10-08

    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 toglutSwapBuffers'
    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 toglutIdleFunc'
    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 toglutInitDisplayMode'
    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 toglutInitWindowPosition'
    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 toglutReshapeFunc'
    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 toglutMainLoop'

    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.

     
    • Osito

      Osito - 2007-10-08

      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.

       
    • moj

      moj - 2007-10-08

      where do i add lib in linker options??

       
      • Wayne Keen

        Wayne Keen - 2007-10-08

        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

         
    • moj

      moj - 2007-10-09

      oh ok thanks for the help, i'll check it out now. thanks again.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.