[Gambas-user] external function again :)
Jussi Lahtinen
jussi.lahtinen at ...626...
Wed Feb 4 17:23:51 CET 2009
If I understand correctly you are trying to call M_PI_4 which is
constant not function/sub.
I don't think you can call constants... and why to bother?
It is as easy to write constants to gambas.
Instead of;
EXTERN M_PI_4() AS Float IN "libgsl"
write example;
PUBLIC CONST M_PI_4 AS Float = what ever
Jussi
On Wed, Feb 4, 2009 at 6:06 PM, Wally <wally at ...2037...> wrote:
> I'm trying to access the GNU Scientific libray and have
> a problem with math constants from this lib.
> The power-functions are working nice.
>
> I try to build the above C-code in gambas and get the
> error-message :
> Cannot find symbol 'M_PI_4' in dynamic library 'libgsl'
>
> These math constants should be available in libgsl and also
> in libc via math.h, but i can't get it to work.
> Where is my mistake ?
>
>
> ' ###########################################################
> ' #include < stdio.h >
> ' #include < gsl / gsl_math.h >
> '
> ' Int main(void)
> ' {
> ' double a;
> ' double d = 5.0;
> '
> ' a = gsl_pow_2(d) * M_PI_4;
> '
> ' printf("Kreisflaeche = %f\n", a);
> ' RETURN 0;
> ' }
> '###########################################################
>
> ' Gambas class file
>
> EXTERN gsl_pow_2(a AS Float) AS Float IN "libgsl"
> EXTERN gsl_pow_int(a AS Float, b AS Integer) AS Float IN "libgsl"
> EXTERN M_PI_4() AS Float IN "libgsl"
>
> PUBLIC SUB Button1_Click()
>
> TextArea1.Text = gsl_pow_2(5) & "\n"
> TextArea1.Text &= gsl_pow_int(5, 3) & "\n"
> TextArea1.Text &= M_PI_4()
>
> END
>
>
> ------------------------------------------------------------------------------
> Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
> software. With Adobe AIR, Ajax developers can use existing skills and code to
> build responsive, highly engaging applications that combine the power of local
> resources and data with the reach of the web. Download the Adobe AIR SDK and
> Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list