From: norry@tky0.attnet.or.jp (Norirhiro Ogata)
Subject: lgamma() and  -lm bug in b18, b19
8 Mar 1998 15:39:10 -0800
Message-ID: <3502EF88.924C73EF.cygnus.gnu-win32@tky0.attnet.or.jp>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
To: gnu-win32@cygnus.com

Something is wrong on using flag "-lm" for linking about function
"lgamma()" of
"math.h".
For example, I tried to comple the following test file:

#include <math.h>
main()
{
 double a=1.0,x;
 x = lgamma(a);
 printf("%lf \n",x);
}

In b18, it failed as follows:

bash$ gcc -O gamma_test.c -lm
C:\gnuwin32\H-i386-cygwin32\lib\gcc-lib\i386-cygwin32\cygnus-2.7.2-970404\../../

.../../i386-cygwin32\lib/libm.a(w_lgamma.o)(.text+0x7):w_lgamma.c:
undefined refe
rence to `signgam'
gcc: Internal compiler error: program ld got fatal signal 1

Also in b19, it failed as follows:

BASH.EXE-2.01$ gcc -O gamma_test.c -lm
C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../../i386-cygwin

32\lib/libm.a(w_lgamma.o)(.text+0x7):w_lgamma.c: undefined reference to
`signgam'

On the other hand,  this test file could be complied in Linux.

Furthermore, the following error can be observed in compiling another
file using flag "-lm":

C:\CYGNUS\B19\H-I386~1\lib\gcc-lib\i386-cygwin32\2.7-B19\../../../../i386-cygwin

32\lib/libcygwin.a(libcmain.o)(.text+0x58):libcmain.cc: undefined
reference to `
WinMain@16'

Please tell me what can I do for solving these problems.

Norihiro Ogata

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
