[Gambas-user] external function again :)

Wally wally at ...2037...
Wed Feb 4 17:06:34 CET 2009


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





More information about the User mailing list