undefined reference to symbol '_end'

Discussion in 'C Programming' started by Eric, Sep 2, 2012.

  1. Eric

    Eric Guest

    Hi

    I am getting the following linker error, however I do not have any _end
    function or variable in my code.

    Can anyone help?

    Thanks

    /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    reference to symbol '_end'
    /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    collect2: ld returned 1 exit status
    Eric, Sep 2, 2012
    #1
    1. Advertising

  2. Eric

    Ian Collins Guest

    On 09/ 3/12 08:44 AM, Eric wrote:
    > Hi
    >
    > I am getting the following linker error, however I do not have any _end
    > function or variable in my code.
    >
    > Can anyone help?
    >
    > Thanks
    >
    > /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    > reference to symbol '_end'
    > /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    > collect2: ld returned 1 exit status


    Something somewhere calls a function called end (the leading underscore
    is added by the compiler). You don't provide enough information for a
    decent answer, but this often happens when

    a) you forget to declare a function
    b) your library header doesn't match the actual library on your machine.

    --
    Ian Collins
    Ian Collins, Sep 2, 2012
    #2
    1. Advertising

  3. Eric <> writes:
    > I am getting the following linker error, however I do not have any _end
    > function or variable in my code.
    >
    > Can anyone help?
    >
    > Thanks
    >
    > /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    > reference to symbol '_end'
    > /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    > collect2: ld returned 1 exit status


    I get 145 hits on a Google search for "undefined reference to symbol '_end'".
    It's likely one or more of them will point you in the right direction.

    It appears to be related to /lib64/libcom_err.so.2, whatever that is.

    A good approach is to narrow down your program to the smallest example
    that reproduces the problem.

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
    Keith Thompson, Sep 2, 2012
    #3
  4. Ian Collins <> writes:

    > On 09/ 3/12 08:44 AM, Eric wrote:
    >> Hi
    >>
    >> I am getting the following linker error, however I do not have any _end
    >> function or variable in my code.
    >>
    >> Can anyone help?
    >>
    >> Thanks
    >>
    >> /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    >> reference to symbol '_end'
    >> /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    >> collect2: ld returned 1 exit status

    >
    > Something somewhere calls a function called end (the leading
    > underscore is added by the compiler). You don't provide enough
    > information for a decent answer, but this often happens when
    >
    > a) you forget to declare a function
    > b) your library header doesn't match the actual library on your
    > machine.


    It's being referred to by a library function and one from a module that
    relates to memory at that. I strongly suspect old Unix code that refers
    to an extern called end. New code might refer to it as well, but it
    shouldn't!

    To the OP: you might try asking in comp.unix.programmer.

    --
    Ben.
    Ben Bacarisse, Sep 2, 2012
    #4
  5. Eric

    Angel Guest

    On 2012-09-02, Keith Thompson <> wrote:
    > Eric <> writes:
    >> I am getting the following linker error, however I do not have any _end
    >> function or variable in my code.
    >>
    >> Can anyone help?
    >>
    >> Thanks
    >>
    >> /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    >> reference to symbol '_end'
    >> /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    >> collect2: ld returned 1 exit status

    >
    > I get 145 hits on a Google search for "undefined reference to symbol '_end'".
    > It's likely one or more of them will point you in the right direction.
    >
    > It appears to be related to /lib64/libcom_err.so.2, whatever that is.


    It's a library that was originally part of the ext2/ext3/ext4 filesystem
    utilities, but is used by some other filesystem-related utilities as
    well. So my guess is that the threat starter is on some brand of Linux.


    --
    "C provides a programmer with more than enough rope to hang himself.
    C++ provides a firing squad, blindfold and last cigarette."
    - seen in comp.lang.c
    Angel, Sep 2, 2012
    #5
  6. Il 9/2/2012 10:44 PM, Eric ha scritto:
    > Hi
    >
    > I am getting the following linker error, however I do not have any _end
    > function or variable in my code.
    >
    > Can anyone help?
    >
    > Thanks
    >
    > /usr/bin/ld: /usr/lib64/libphobos2.a(memory_350_620.o): undefined
    > reference to symbol '_end'
    > /lib64/libcom_err.so.2: could not read symbols: Invalid operation
    > collect2: ld returned 1 exit status
    >


    Phobos is the standard runtime library that comes with the D language
    compiler "dmd". You should ask in another newsgroup:
    http://www.digitalmars.com/NewsGroup.html

    However, I found this thread where quite the same error message is
    reported, the suggested solution could apply to your case as well:
    http://goo.gl/eVVMo

    --
    Vincenzo Mercuri
    Vincenzo Mercuri, Sep 2, 2012
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kenneth Kahl
    Replies:
    2
    Views:
    12,124
    Kenneth Kahl
    Feb 22, 2006
  2. baumann@pan
    Replies:
    1
    Views:
    742
    Richard Bos
    Apr 15, 2005
  3. Replies:
    3
    Views:
    4,226
    Greg Comeau
    Sep 29, 2006
  4. Song Ma
    Replies:
    2
    Views:
    228
    Charles Oliver Nutter
    Jul 20, 2008
  5. Replies:
    6
    Views:
    1,777
Loading...

Share This Page