1

I am trying to call external functions inside of a DLL from a Jython script using ctypes.

The prototype is declared as:

extern cl_error_t funcname(const char **varname)

That's why I tried to create the following type:

import ctypes
c_char_pp = ctypes.POINTER(ctypes.c_char_p)

But when I run the code, I get the following error:

java -jar C:\jython2.7.2\jython.jar example.py
Traceback (most recent call last):
  File "example.py", line 3, in <module>
    c_char_pp = ctypes.POINTER(ctypes.c_char_p)
  File "C:\jython2.7.2\Lib\ctypes\__init__.py", line 167, in POINTER
    dict = { '_jffi_type': jffi.Type.Pointer(ctype) }
TypeError: pointer only supported for scalar types

The same code in CPython works fine. Are there any tricks to help solve the problem? Thank you.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.