This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: where did memcpy come from????


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]