How to use Soft Declare for the libpigpio.so

Hallo,
I try to use the shared library libpigpio.so via the Soft Declare function,
but I got a FunctionNotFoundException when I try to initialise the library with the following command.

#IF TargetARM AND TargetLinux then
Soft Declare Function gpioInitialise Lib “libpigpio.so” Alias “xoInitialise” As Integer
Return gpioInitialise
#Endif

Why are you using an alias here? Is the external method named “xoInitialise” or “gpioInitialise”?

Dear Andrew,

thank you for the question.

I copied the Soft Declare structure from an example program and this was the wrong way.

Now I use the call

#IF TargetARM AND TargetLinux then
Soft Declare Function gpioInitialise Lib “libpigpio.so” () As Integer
Return gpioInitialise
#Endif

and I have to call my GUI program via the sudo command.

It is now working.

Pigpio is a nice library waiting to be wrapped.