linker error: 'undefined reference'

linker error: 'undefined reference'

Post by Nils M Hol » Tue, 13 Mar 2001 00:17:11



I have received a message stating that my T3X port is broken, but I cannot
reproduce the error, so I assume it specific to the 5.x linker. (I am
running 3.3 FreeBSD). The error log says:

txtrn_1.o: In function `_TXSTART_':
txtrn_1.o(.text+0xc): undefined reference to `__exit'

__exit is called at this line. I guess that the reason for this message
is a lacking declaration of __exit, but I have no idea how to fix it.

The port builds without any problems on 2.2.8, 3.3 and 4.1.

Bye,
        nmh.

--

 
 
 

linker error: 'undefined reference'

Post by Nils M Hol » Tue, 13 Mar 2001 00:27:14




Quote:> __exit is called at this line. I guess that the reason for this message
> is a lacking declaration of __exit, but I have no idea how to fix it.

I forget to say that I need an *assembly language* declaration for a
call to __exit, not C. There is only one line containing '__exit' in the
whole program and it reads

call __exit

My guess is that the 5.x linker requires a declaration like

.extrn __exit

in the text segment, but since I have no 5.x FreeBSD installed, I cannot
verify this.

--