Request help to debug errors while running in 'C'

I run, 2 'C' Files, gapw.c and getkey.c, but I get the following errors :-

I) $ gcc gapw.c

gapw.c: In function `main':
gapw.c:96: warning: cast to pointer from integer of different size
/tmp/cck4I8mW.o(.text+0x227): In function `main':
: undefined reference to `getprofilestring'
/tmp/cck4I8mW.o(.text+0x2f6): In function `main':
: undefined reference to `getprofilestring'
collect2: ld returned 1 exit status

II) $gcc getkey.c

getkey.c: In function `main':
getkey.c:65: warning: cast to pointer from integer of different size
/tmp/ccQlGq7C.o(.text+0xea): In function `main':
: undefined reference to `getprofilestring'
/tmp/ccQlGq7C.o(.text+0x1ab): In function `main':
: undefined reference to `getallappkey'
/tmp/ccQlGq7C.o(.text+0x26c): In function `main':
: undefined reference to `getappkeys'
/tmp/ccQlGq7C.o(.text+0x321): In function `main':
: undefined reference to `getallapp'
/tmp/ccQlGq7C.o(.text+0x3f1): In function `main':
: undefined reference to `writeprofilestring'
collect2: ld returned 1 exit status

I included the following header files in my code, but still the errors are not removed :-

                          \#include <stdlib.h>
                          \#include <libgen.h>

I think these are some generic errors. Request you to please help me to debug the errors.

Thanks in advance.

Regards,
Marconi.

Those are linker errors. I don't know much about libgen, but this answer assumes there is a libgen.* file in the /usr/lib/ directory. If it is not you will have to find it and then learn how to get gcc to see it with -L

gcc gapw.c -lgen -o gapw
# you also have a syntax error in getkey.c  warnings mean it is wrong - you should fix it.
# look at line 65 in your code.
gcc getkey.c -lgen -o getkey

I added the -o <file> part because by default the compiler creates ./a.out each time you invoke the compiler. The second invocation of gcc will write over the first compile.