Find the answer to your Linux question:
Results 1 to 2 of 2
Hello all, trying to compile a c program using cc in terminal, getting this error: cannot post at symbols because of forum rules, replaced with (atsymbol): ndefined reference to symbol ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2012
    Posts
    3

    Compiling undefined reference to symbol help


    Hello all, trying to compile a c program using cc in terminal, getting this error:

    cannot post at symbols because of forum rules, replaced with (atsymbol):

    ndefined reference to symbol 'pthread_key_delete(atsymbol)(atsymbol)GLIBC_2.0'
    /usr/bin/ld: note: 'pthread_key_delete(atsymbol)(atsymbol)GLIBC_2.0' is defined in DSO /usr/lib/libpthread.so.0 so try adding it to the linker command line
    /usr/lib/libpthread.so.0: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status

    I believe I have to add -lpthread, but where and how? Thanks

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by vingilot View Post
    ndefined reference to symbol 'pthread_key_delete(atsymbol)(atsymbol)GLIBC_2.0'
    /usr/bin/ld: note: 'pthread_key_delete(atsymbol)(atsymbol)GLIBC_2.0' is defined in DSO /usr/lib/libpthread.so.0 so try adding it to the linker command line
    /usr/lib/libpthread.so.0: could not read symbols: Invalid operation
    collect2: error: ld returned 1 exit status

    I believe I have to add -lpthread, but where and how?
    What is your distro? On my Fedora 16 system, that file is installed with the glibc package. On my RHEL 4 system, it is part of the glibc-devel package. Search your distro repos for something similar.

    If that is not it, are you maybe on a 64-bit OS?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •