Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!rochester!cornell!uw-beaver!rice!sun-spots-request From: ELESKG%NUSVM.BITNET@cunyvm.cuny.edu (Winston Seah) Newsgroups: comp.sys.sun Subject: SUNOS 4.0 math library functions Keywords: SunOS Message-ID: <3829@kalliope.rice.edu> Date: 16 Jun 89 09:41:06 GMT Sender: usenet@rice.edu Organization: Sun-Spots Lines: 22 Approved: Sun-Spots@rice.edu X-Sun-Spots-Digest: Volume 8, Issue 29, message 10 of 17 I am doing some simple simulations using C on a SUN 3/140 running SunOS 4.0. However, I encountered problems using 'cc'; the loader 'ld' cannot find the math library (math.h/libm.a) functions, such as log() or exp(), when I type cc -lm -o sim1 sim1.c The -lm flag is supposed to include the math lib as instructed by the manuals. To overcome that I did the following, cc -c sim1.c ld -lm -o sim1 sim1.o This went thru, but the image crashed when I executed it - segmentation fault. I compiled and executed this program on a PC using Turbo C 2.0 successfully. Am I compiling the program in the right manner? Or have I missed some critical flags? Winston Seah Dept of EE, National University of Singapore ELESKG@NUSVM.BITNET