You need to read some tutorials about using GCC.
You might want to try to compile and link with with
gcc -std=c99 -Wall -g xx.c -L. -lmem
(assuming your current directory [not folder] i.e. the .
in -L.
contains a libmem.a
or libmem.so*
library)
BTW, order of program arguments to gcc
matters a big lot!