About [Linker error]

Discussion in 'C++' started by Nawaz, Apr 11, 2010.

  1. Nawaz

    Nawaz Guest

    Hello..

    While coding I got linker error which is bellow.

    [Linker error] undefined reference to `setdate(date&)'
    ld returned 1 exit status

    now I want to know that what is the meaning of this error & what is
    "id" & exit status ..

    thanks for giving answer ...


    <<|\| /\ |^| /\ Z>>
    Nawaz, Apr 11, 2010
    #1
    1. Advertising

  2. Nawaz

    Nawaz Guest

    Re: About [Linker error]

    On Apr 12, 12:57 am, Nawaz <> wrote:
    > Hello..
    >
    > While coding I got linker error which is bellow.
    >
    >          [Linker error] undefined reference to `setdate(date&)'
    >          ld returned 1 exit status
    >
    > now I want to know that what is the meaning of this error &  what is
    > "ld" & exit status ..
    >
    > thanks for giving answer ...
    >
    > <<|\| /\ |^| /\ Z>>
    Nawaz, Apr 11, 2010
    #2
    1. Advertising

  3. Nawaz

    Kai-Uwe Bux Guest

    Nawaz wrote:

    > While coding I got linker error which is bellow.
    >
    > [Linker error] undefined reference to `setdate(date&)'
    > ld returned 1 exit status
    >
    > now I want to know that what is the meaning of this error


    Somewhere in your code, you use a function setdate(), which apparently comes
    from a library. The code compiles fine since you included the header where
    setdate() is declared. However, the header does not provide the definition.
    For that reason, the linker needs to include the library. Apparently, the
    linker did not know where to look for it. You need to give it a hint. This
    is done via linker options. How the mechanism works for your compiler/linker
    should be in the documentation that comes with them.

    > & what is "id" & exit status ..


    When programs return, the pass an exit status (an integer) to the calling
    environment. That way, a script can check whether a program terminated
    successfully or not without analyzing the output. The linker you use exits
    with status 1 when it detects an undefined reference.


    Best

    Kai-Uwe Bux
    Kai-Uwe Bux, Apr 11, 2010
    #3
    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. Wolfgang Rueckert

    Linker error - unsolved external symbol

    Wolfgang Rueckert, Jun 30, 2003, in forum: C++
    Replies:
    0
    Views:
    711
    Wolfgang Rueckert
    Jun 30, 2003
  2. Martin Magnusson

    Linker error with static const field

    Martin Magnusson, Oct 20, 2003, in forum: C++
    Replies:
    2
    Views:
    444
    Ron Natalie
    Oct 20, 2003
  3. Arne Schmitz
    Replies:
    3
    Views:
    357
    E. Robert Tisdale
    Apr 16, 2004
  4. TR
    Replies:
    3
    Views:
    8,150
    New_user
    Jun 10, 2004
  5. quad
    Replies:
    3
    Views:
    2,311
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=
    Jun 9, 2007
Loading...

Share This Page