Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I have seen this error for the first time and there are less references in web. can some one please point me out what causing this error. /home/Prgs/a.out: relocation ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    21

    link time reference error


    Hi,

    I have seen this error for the first time and there are less references in web.

    can some one please point me out what causing this error.

    /home/Prgs/a.out: relocation error:
    /home/Prgs/a.out: symbol printf, version GLIBC_2.2.5 not defined in file libc.so.6 with link time reference

    through GBD when i checked it is generated when the program encountred a printf statement .
    But the same code(code having printf statements)was working perfectly some time back.

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    What changed since it worked? The printf() function is part of libc, so either you installed a new/different version of libc, or you changed something in your program or how you build/link it. Basically, you aren't providing enough information.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Dec 2011
    Posts
    21
    I really dont know what i have changed, but after inserting some printf statements here and there for debugging (just to check all printfs are causing the problem or just one.) the problem is solved just like that.
    But the problem is not known.

    Thanks RubberMan for your response.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,737
    This sort of symptom is usually due to some sort of memory error, such as using an invalid pointer or writing beyond the object a pointer refers to, thus causing corruption to parts of the program that may have been related to your issue - the results can be totally random, and will change as you add/remove code (such as printf statements) in the function(s) that caused the problem. You should use a tool such as valgrind in order to find where the memory corruption may be occurring.

    As a software developer, never let an issue like this go without understanding exactly what was happening, and what the proximate cause was, otherwise some minor fix is going to cause the issue to reappear at a later time.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

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