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

Benoit Minisini gambas at ...1...
Wed Jun 11 23:44:02 CEST 2008


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