This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gamma(lgamma) error in libm(signgam undeclared)


Cliff Tsai wrote:
> 
> Hi:
>     When using gamma and lgamma in libm,
>     I have the error: siganam undeclared.
>     And after adding following two lines(suggestion from From: "J. Johnston"
> <jjohnstn at cygnus dot com>
>         Date: Mon, 29 Jan 2001 18:01:30 -0500 )
>     extern __IMPORT struct _reent reent_data;
>     #define signgam reent_data._new._reent._gamma_signgam
> 
>     I have another problem:undefined reference to `reent_data'.
> 
>     I've seen the struct _reent is defined in sys/reent.h .
>     math.h also have #include <sys/reent.h>.
>     But I still can't find out what's the problem!
> 
>     Thanks for any help!

Cliff,

  The signgam stuff was reworked about that time into an errno-like solution.  Make sure you have
the patch from 01-29 applied or just use the current CVS sources:

2001-01-29  Jeff Johnston  <jjohnstn@redhat.com>

        * libc/include/math.h (signgam): Change to errno-like solution
        using a function to return the address of the real signgam.
        * libc/reent/signgam.c: New file containing __signgam().
        * libc/reent/Makefile.am: Added signgam.c to list of files.
        * libc/reent/Makefile.in: Regenerated.

In your application, you need:

    #include <math.h>

    extern int signgam;

-- Jeff J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]