# Re: \[personal kdb+\] Undefined reference to 'khp' when compiling c.c

**URL:** <https://forum.kx.com/t/re-personal-kdb-undefined-reference-to-khp-when-compiling-c-c/8174>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [March 9, 2013, 9:35am UTC](https://forum.kx.com/t/re-personal-kdb-undefined-reference-to-khp-when-compiling-c-c/8174 "2013-03-09T09:35:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlie1](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@charlie1](https://forum.kx.com/u/charlie1)\
**Post date:** [March 9, 2013, 9:35am UTC](https://forum.kx.com/t/re-personal-kdb-undefined-reference-to-khp-when-compiling-c-c/8174/1 "2013-03-09T09:35:00Z")

</div>

\> I am trying to compile c.c

looks like you are trying to compile testk.c?

The kx c-api library is distributed as c.o or c.dll, depending on your target OS. It can be downloaded from&nbsp;

http://kx.com/q/l32/c.o &nbsp; &nbsp;/ linux 32 bit

http://kx.com/q/w32/c.dll / windows 32bit

http://kx.com/q/m32/c.o / osx 32bit

etc.

Then if using gcc, assuming that testk.c, c.o and k.h are in the current directory,

compile as

gcc -m32 -D KXVER=3 testk.c c.o -o testk -lpthread

thanks
