home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / sgi / 11441 < prev    next >
Encoding:
Text File  |  1992-07-27  |  1.6 KB  |  66 lines

  1. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!jvnc.net!rutgers!cmcl2!mcclb0.med.nyu.edu!siegel
  2. From: siegel@mcclb0.med.nyu.edu
  3. Newsgroups: comp.sys.sgi
  4. Subject: HELP! What's wrong with this code?...
  5. Message-ID: <1992Jul27.102418.1@mcclb0.med.nyu.edu>
  6. Date: 27 Jul 92 15:24:18 GMT
  7. Sender: notes@cmcl2.nyu.edu (Notes Person)
  8. Organization: NYU Medical Center, New York, NY 10016, USA
  9. Lines: 54
  10. Nntp-Posting-Host: mcclb0.med.nyu.edu
  11.  
  12. I can't seem to get the following code to work. I gives a Segmentation
  13. Fault on the last line:
  14.  
  15. /*********************** CODE BEGINS HERE *********************/
  16.  
  17. /* Compile with: cc smalltest.c -lXm -lXt -lX11 -o smalltest
  18. */
  19.  
  20. #include <stdio.h>
  21. #include <X11/Xlib.h>
  22. #include <X11/Xutil.h>
  23. #include <Xm.Xm.h>
  24. #include <Xm/Form.h>
  25. #include <X11/Xirisw/GlxMDraw.h>
  26. #include <X11/Xirisw/GlxDraw.h>
  27. #include <X11/keysym.h>
  28. #include <gl/gl.h>
  29. #include <gl/device.h>
  30. #include <math.h>
  31.  
  32. static XtAppContext app_context;
  33.  
  34. static XrmOptionDescRec SGIoptions =
  35.     {"-display", "*display", XrmoptionNoArg, "mchip02:0.0"};
  36. static Cardinal num_options = 1;
  37.  
  38. Widget SGItoplevel, MACtoplevel;
  39.  
  40. Display *MACdisplay;
  41.  
  42. main(int argc, char **argv)
  43. {
  44.     SGItoplevel = XtAppInitialize
  45.     (
  46.         &app_context,
  47.         "GLcanvas",
  48.         &SGIoptions,
  49.         num_options,
  50.         &argc, argv,
  51.         NULL, /* instead of fallback_resources */
  52.         NULL,
  53.         0
  54.     );
  55.  
  56.     MACdisplay = XtOpenDisplay(&app_context, "Display_Canvas",
  57.         "glcanvas", "GLcanvas", NULL, 0, &argc, argv);
  58.     MACtoplevel = XtAppCreateShell("glcanvas", "GLcanvas",
  59.         topLevelShellWidgetClass, MACdisplay, NULL, 0);
  60. }
  61.  
  62. I appreciate any help anyone can give. Please reply via email:
  63.     siegel@med.nyu.edu
  64.     Chris Siegel
  65.     NYU School of Medicine
  66.