# Running C code from jitted function

**URL:** <https://numba.discourse.group/t/running-c-code-from-jitted-function/1379>\
**Category:** Support: How do I do ...?\
**Created:** [June 12, 2022, 5:26pm UTC](https://numba.discourse.group/t/running-c-code-from-jitted-function/1379 "2022-06-12T17:26:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bencebecsy](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/bencebecsy/32/617_2.png) [@bencebecsy](https://numba.discourse.group/u/bencebecsy)\
**Post date:** [June 12, 2022, 5:26pm UTC](https://numba.discourse.group/t/running-c-code-from-jitted-function/1379/1 "2022-06-12T17:26:07Z")

</div>

Hi, I’m trying to call a function from a C library (GSL) within a jitted function. I think the way to do it is with a WrapperAddressProtocol object. However, I tried the example code here:

[https://numba.pydata.org/numba-doc/latest/reference/types.html#wrapper-address-protocol-wap](https://numba.pydata.org/numba-doc/latest/reference/types.html#wrapper-address-protocol-wap)

and it gives the following error:

```auto
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
non-precise type pyobject
During: typing of argument at /home/beno/Dropbox/Szakma/Research/BayesHopperRealistic/Code/GSL/ctype_test.py (13)

File "ctype_test.py", line 13:
def foo(f, x):
    return f(x)
    ^

```

Am I doing something wrong here? Or is this a bug?

Also, if this is not the easiest way to call a C executable from a jitted function, I’m open to suggestions.

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![guilherme](https://yyz2.discourse-cdn.com/free1/user_avatar/numba.discourse.group/guilherme/32/111_2.png) [@guilherme](https://numba.discourse.group/u/guilherme)\
**Post date:** [July 26, 2022, 9:23pm UTC](https://numba.discourse.group/t/running-c-code-from-jitted-function/1379/2 "2022-07-26T21:23:05Z")

</div>

I reported this in the issue tracker. But as a quick fix, try to add the following import at the top of your script:

```python
from numba.experimental import function_type

```

This should make Numba aware of the WAP protocol
