我正在开发一个嵌入式项目,并且因为这个错误而努力编译它:
mipsel-linux-gnu-ld: main.o: in function 'fooBar':main.c:(.text+0x3ec): undefined reference to 'memcpy'
这个错误是由与此类似的每个操作引起的,其中我将指针的值分配给非指针类型变量。
int a = 0;
int *ap = &a;
int c = *ap; //this causes the error
这是另一个例子:
state_t *exceptionState = (unsigned int) 0x0FFFF000;
currentProcess->cpu_state = *excepetionState; //this causes the error
我已经-nostdlib在makefile中包含了标志......
提前谢谢你!