# Can't recognise khpun, khp functions...

**URL:** <https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519>\
**Category:** Community Support\
**Tags:** imported, kdb-and-q\
**Created:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519 "2023-07-18T00:00:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzadonis369](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/hzadonis369/32/128_2.png) [@hzadonis369](https://forum.kx.com/u/hzadonis369)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/1 "2023-07-18T00:00:00Z")

</div>

[https://learninghub.kx.com/forums/topic/cant-recognise-khpun-khp-functions](https://learninghub.kx.com/forums/topic/cant-recognise-khpun-khp-functions)

I’m using the new kdb package which downlaod from Github([https://github.co](https://github.co,")/KxSystems/kdb), it has the C API interface to convert data into K type.

While I write code in Visual Studio and try to compile it, there’re error message. Such as: can’t recognize khpun, khp function.

---

<div class="post-metadata">

**Author:** ![dcrossey2](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@dcrossey2](https://forum.kx.com/u/dcrossey2)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/2 "2023-07-18T00:00:00Z")

</div>

Have you included the [k.h](https://github.com/KxSystems/kdb/blob/master/c/c/k.h") header file in your code?

There is a good whitepaper from using the capi you can follow [here](https://code.kx.com/q/wp/capi/")

---

<div class="post-metadata">

**Author:** ![hzadonis369](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/hzadonis369/32/128_2.png) [@hzadonis369](https://forum.kx.com/u/hzadonis369)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/3 "2023-07-18T00:00:00Z")

</div>

Thanks davidcrossey. I had included the k.h in my cpp file.

It seems khpun function in k.h can’t be invoked.

---

<div class="post-metadata">

**Author:** ![dcrossey2](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@dcrossey2](https://forum.kx.com/u/dcrossey2)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/4 "2023-07-18T00:00:00Z")

</div>

Did you compile your code and link against the c.o object file too? Check out [kdb/l64/c.o at master KxSystems/kdb GitHub](https://github.com/KxSystems/kdb/blob/master/l64/c.o") If you need a different OS binary, check out the directories at the root of the repo.

More info here: [C/C++ | Interfaces | kdb+ and q documentation - Kdb+ and q documentation (kx.com)](https://code.kx.com/q/interfaces/c-client-for-q/")

---

<div class="post-metadata">

**Author:** ![hzadonis369](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/hzadonis369/32/128_2.png) [@hzadonis369](https://forum.kx.com/u/hzadonis369)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/5 "2023-07-18T00:00:00Z")

</div>

Thanks, My OS is Win10 64bit.

I’m reading the doc([https://code.kx.com/q/wp/capi/#creating-a-simple-list-object](https://code.kx.com/q/wp/capi/#creating-a-simple-list-object")) and want to copy sample code into my Visual Studio env. But why I can’t find the “common.h” file?

---

<div class="post-metadata">

**Author:** ![hzadonis369](https://sea2.discourse-cdn.com/flex002/user_avatar/forum.kx.com/hzadonis369/32/128_2.png) [@hzadonis369](https://forum.kx.com/u/hzadonis369)\
**Post date:** [July 18, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/6 "2023-07-18T00:00:00Z")

</div>

I did test based on the source code from Github, for example the portopen.c, common.h, k.h

But error message reports at my Visual Studio env: E0167 “const char \*” “S”

Does the k.h works fine at Win10 64bit env?

---

<div class="post-metadata">

**Author:** ![dcrossey2](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@dcrossey2](https://forum.kx.com/u/dcrossey2)\
**Post date:** [July 19, 2023, 12:00am UTC](https://forum.kx.com/t/cant-recognise-khpun-khp-functions/13519/7 "2023-07-19T00:00:00Z")

</div>

Yes it can be used on w64, however there are differences in terms of the libraries needed for linking: [kdb/w64 at master KxSystems/kdb (github.com)](https://github.com/KxSystems/kdb/tree/master/w64")

This repo: [kxcontrib/capi (github.com)](https://github.com/kxcontrib/capi") only supports Linux based environments. You could fork it and add Windows support yourself, or a more straight forward solution would be to setup WSL2 with a \*nix distribution (such as Ubuntu), and use that environment for your local development - works with VS Code.
