[Gambas-user] haw to call the "C or C++" function suma(a, b) from gambas?

Adrian Martínez Vargas amvargas at ...1922...
Sat Jun 14 01:23:55 CEST 2008


It really work very nice (better than visual basic), now I can do math in 
C++ static classes and GUIs with Gambas. The only that y see is missing is 
that Gambas be cross plataform (widows +linux +Unix, etc.)



MY BEST TO YOW Benoit

Adrian



----- Original Message ----- 
From: "Benoit Minisini" <gambas at ...1...>
To: "Adrian Martínez Vargas" <amvargas at ...1922...>; "mailing list for 
gambas users" <gambas-user at lists.sourceforge.net>
Sent: Wednesday, June 11, 2008 5:44 PM
Subject: Re: [Gambas-user] haw to call the "C or C++" function suma(a, b) 
from gambas?


On mardi 10 juin 2008, Adrian Martínez Vargas wrote:
> Hello mail list
>
> If I have a shared library written in C++ that look like this:
>
>
> // suma.cc:
>        extern "C"
>            {
>                float suma (float a, float b)
>                  {
>                         return a+b;
>                  }
>             } // extern "C"
>
>  haw to call the function suma(a,b) from gambas?
>
>
>
> my best
> Dr. Adrian Martínez Vargas
> Revista Minería y Geología (Editor Principal)
> ISMM, Las Coloradas, s/n
> Moa, Holguín,
> Cuba
> CP. 83329
> http://www.ismm.edu.cu/revistamg/index.htm
>
>

EXTERN suma(A AS Single, B AS Single) AS Single IN "mylibrary.so:X"
' where X is the version number of the library.

PRINT suma(1.0, 2.0)

See the wiki documentation for more details.

Regards,

-- 
Benoit Minisini






More information about the User mailing list