[Gambas-user] cannot find symbol sinh in libc

Tobias Boege taboege at gmail.com
Mon Jun 11 10:07:02 CEST 2018


On Mon, 11 Jun 2018, Demosthenes Koptsis wrote:
> hello,
> 
> according https://www.gnu.org/software/libc/manual/html_node/Hyperbolic-Functions.html#Hyperbolic-Functions
> 
> i have this external function
> 
> 'double sinh (double x)
> Public Extern sinh_C(x As Float) As Float Exec "sinh"
> 
> but i get the error "cannot find symbol sinh in libc"
> 
> why?
> 

Because it is in libm:

  Extern my_sinh(f As Float) As Float In "libm:6" Exec "sinh"

  Print Sinh(20)
  Print my_sinh(20)

  >242582597.704895
  >242582597.704895

At least on my system, the manpage of sinh tells you to "Link with -lm."

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list