[Gambas-user] Get structure from extern function?

CJ lists at ...2828...
Fri Jul 4 02:00:54 CEST 2014


Sorry if this message appears twice on the list, had some issues posting
again...

> Can you show the C code of that shared library ?

It's a shared library written in Free Pascal 2.6.2. Attached is source code
as
well as a compiled library for Xubuntu 14.xx (i386), it's very basic code...

To install the library copy the file libtest.so to "/usr/local/lib" and then
type "ldconfig".

In the library are two functions exported. Tripple is only there to see that
the library works...

  Tripple
  LIBVersion

The simple Gambas 3 demo first calls Tripple with "3" as an argument and
then
calls LIBVersion() but crashes the interpreter with a Segmentation fault
(11) message.

Comment out the call to LIBVersion() and you should see "9" on the form.

/CJ

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.pas
Type: application/octet-stream
Size: 585 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140704/49ab3ae2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libtest.tar.gz
Type: application/x-gzip
Size: 337086 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20140704/49ab3ae2/attachment.bin>


More information about the User mailing list