where did memcpy come from????

Wei Qin wqin@EE.Princeton.EDU
Wed Nov 6 10:10:00 GMT 2002


It is normal to see memcpy, but not not normal if it cannot be found.

Compiler generates memcpy for structure copying.
So if you have something like

struct {
...
} x,y;

x=y;

a memcpy will be generated (x86 has the rep instruction, so memcpy can be
saved).

Normally memcpy should be in libc, which is linked by default. You may
use the -v switch of gcc to see which libraries are linked.

Wei


On Wed, 6 Nov 2002, Mark Cianfaglione wrote:

> I've been trying to cross compile a piece of code that I'm trying to port
> and I'm getting the following error:
>
> GNU ld version 2.11.94 20020209
> ./obj/uip_arp.o: In function `uip_arp_arpin':
> ./obj/uip_arp.o(.text+0x56c): undefined reference to `memcpy'
> *** Error exit code 1
>
> Stop.
> [ethernet]=23=>
>
> When I look at the source (the 'C' file) there is no reference to memcpy. In
> the assembler file it is there...
>
> My question is... Is this normal? And if it is how does one correct the
> error?
>
> Mark
>
>
>
>



More information about the Gcc-help mailing list