Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Message-ID: <80575AFA5F0DD31197CE00805F650D7602CDD9@wilber.adroit.com> From: "Robinow, David" To: "'Charles Werner'" , cygwin AT sourceware DOT cygnus DOT com Subject: RE: Possible bug: gamma function missing global variable in libm Date: Mon, 23 Oct 2000 09:25:26 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" > I have been attempting to use the gamma functions > in libm. The following program does not compile: It appears that it does compile. It doesn't link. > > /*** test1.c ****/ > #include > #include > > int main(void) > { > signgam = 0; > exit(0); > } > > gcc test1.c -lm > > $ gcc test1.c -lm > /c/TEMP/ccQLwcGF.o(.text+0xd):test1.c: undefined reference to > `signgam' > collect2: ld returned 1 exit status > > Signgam is a global variable required for > the gamma functions. In the cygwin math.h: > > $ grep signgam math.h > > math.h:/* The gamma functions use a global variable, signgam. */ > math.h:extern int signgam; > > It must be missing from libm. Not at all. That's the only reason test1.c compiles. math.h tells the compiler that "signgam" is an int. Where on your computer do you think "signgam" should be stored? > This program compiles without difficulty with gcc under Solaris. As mentioned above, it compiles under Cygwin. Does it link under Solaris? -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com