Wednesday, July 25, 2012

openGL : Fedora 17 : undefined reference to symbol 'cos@@GLIBC_2.0'

  1. ERROR:

    gcc wave.o -o wave -I/usr/include -L/usr/lib -lglut -lGL -lGLU -lX11 -m32
    /usr/bin/ld: wave.o: undefined reference to symbol 'cos@@GLIBC_2.0'
    /usr/bin/ld: note: 'cos@@GLIBC_2.0' is defined in DSO /lib/libm.so.6 so try adding it to the linker command line
    /lib/libm.so.6: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status
  2. Solution:
    Add '-lm' flag while compiling.

    gcc wave.o -o wave -I/usr/include -L/usr/lib -lglut -lGL -lm  -lGLU -lX11 -m32

1 comment:

  1. Thanks for the solution! I was surprised when I found this error on fedora 18 and I didn't know what to do! Thanks!

    ReplyDelete