Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!BRL.MIL!butler From: butler@BRL.MIL ("Lee A. Butler") Newsgroups: comp.sys.sgi Subject: Graphics library examples Message-ID: <9003082054.aa06458@VMB.BRL.MIL> Date: 9 Mar 90 01:54:43 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 46 This evening I sat down at the IRIS to start learning to use the graphics library. On page 1-5 of the "Graphics Library Programming Guide" is the program "red.c" which I typed in verbatim: #include main() { prefposition(100, 500, 200, 600); shademodel(FLAT); winopen("red"); color(RED); clear(); sleep(5); } then I compiled with the command line in the manual: % cc red.c -lgl -o red And tried to run the result: % red Segmentation fault (core dumped) % dbx red dbx version 1.31 1/22/90 2:02 Copyright 1987 Silicon Graphics Inc. Copyright 1987 MIPS Computer Systems Inc. Type 'help' for help. Reading symbolic information of `red' . . . Process name from core dump: red Process died at pc 0x400774 of signal : segmentation violation [using memory image in core] (dbx) where > 0 shademodel(0x64, 0x1f4, 0xc8, 0x258, 0x0, 0x400214) [0x400770] 1 main() ["red.c":7, 0x400260] (dbx) q I noticed that if you leave out the call to "shademodel" the program works as advertised. Lee A. Butler SLCBR-VL-V Internet: butler@brl.mil Ballistic Research Laboratory Phone: (301) 278-8740 Aberdeen Proving Grounds, MD 21005-5066