About [Linker error]

N

Nawaz

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>>
 
N

Nawaz

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>>
 
K

Kai-Uwe Bux

Nawaz said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top