Use of malloc primitives in Genode

Amadeo Cuadrado amadeo.c at ...58...
Tue Mar 15 20:53:38 CET 2011


Hello,

 

When I try to build the app below in Genode, the following linking error
happens:

 

main.o: In function `main':

.../main.cc:6: undefined reference to `malloc(unsigned int)'

.../main.cc:8: undefined reference to `free(void*)'

 

What am I missing here? Thanks!

 

Amadeo

 

 

::::::::::::::

main.cc

::::::::::::::

#include <stdlib.h>

 

#define N 10

 

int main(void) {

  int *v = (int *) malloc(N*sizeof(int));

  for (int i=0; i<N; i++) v[i] = i;

  free(v);

}

::::::::::::::

target.mk

::::::::::::::

TARGET = foo

SRC_CC = main.cc

LIBS   = cxx env mini_c

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20110315/7b4d9ad5/attachment.html>


More information about the users mailing list