home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / fj / maillis / xwindow / 17641 < prev    next >
Encoding:
Internet Message Format  |  1992-11-19  |  2.7 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
  2. From: c2xlai@kocrsv01.delcoelect.com (Larry A. Ice)
  3. Newsgroups: fj.mail-lists.x-window
  4. Subject: Re: Translation Manager example problem
  5. Message-ID: <1992Nov19.113552.8772@sm.sony.co.jp>
  6. Date: 19 Nov 92 11:35:52 GMT
  7. Sender: daemon@sm.sony.co.jp (The devil himself)
  8. Distribution: fj
  9. Organization: Delco Electronics Corp.
  10. Lines: 74
  11. Approved: michael@sm.sony.co.jp
  12.  
  13. Date: 16 Nov 92 14:14:17 GMT
  14. Message-Id: <1992Nov16.141417.28774@kocrsv01.delcoelect.com>
  15. Newsgroups: comp.windows.x
  16. References: <1992Nov12.162841.4505@kocrsv01.delcoelect.com>
  17. Sender: xpert-request@expo.lcs.mit.edu
  18.  
  19.  
  20. In article <1992Nov12.162841.4505@kocrsv01.delcoelect.com>, c2xlai@kocrsv01.delcoelect.com (Larry A. Ice) writes:
  21. > I am working on the example programs in Doug Young's book:
  22. > 'The X Window System, Programming and Applications with Xt
  23. > (OSF/Motif Edition)'.  In chapter two, 'Programming with the
  24. > Xt Intrinsics' in section 2.4.5, 'Using the Translation
  25. > Manager', there is an example of the memo program which uses
  26. > the Translation Manager to bind the key sequence <Key>Q to the
  27. > ArmAndActivate action procedure.
  28. > extern void quit();
  29. > static XtActionsRec actionsTable  [] = {
  30. >     {"bye",     quit},
  31. > };
  32. > static char defaultTranslations[] = "<Key>Q:    bye()";
  33. > main(argc, argv)
  34. >     int         argc;
  35. >     char        *argv[];
  36. > {
  37. > ************************************************************
  38. > Here is the definition of quit():
  39. > #include <X11/Intrinsic.h>
  40. > static void quit(w, event, params, num_params)
  41. >     Widget      w;
  42. >     XEvent      *event;
  43. >     String      *params;
  44. >     Cardinal    *num_params;
  45. > {
  46. >     XtCloseDisplay(XtDisplay(w));
  47. >     exit(0);
  48. > }
  49. > ***********************************************************
  50. > THE PROBLEM occurs when I attempt to build the program:
  51. > [311] koptsw32: make
  52. > rm -f memo
  53. > cc -o memo memo.o quit.o -O  -lXm -lXt -lX11  -lXs -L/users/c2xlai/xwin
  54. > ld: Undefined symbol
  55. >    _quit
  56. > *** Error code 2
  57. > make: Fatal error: Command failed for target `memo'
  58. > What's wrong with this code?
  59.  
  60. OOPS!  I declared quit with:
  61.  
  62. static void quit(w, event, params, num_params)
  63.  
  64. By declaring quit static, I kept it hidden from memo and the
  65. linker was unable to resolve the reference.  Removing the
  66. static declaration allowed the linker to resolve the reference
  67. successfully.
  68.  
  69.  
  70.  
  71. -- 
  72.  .+----+     Larry Ice (317)451-0890     GM: 8-322-0890      .+----+
  73. +----+'|     Software Engineer           Mail: CT40A        +----+'|
  74. |    | |     Domain: c2xlai@kocrsv01.delcoelect.com         |    | |
  75. |____|'      UUCP: deaes!c2xlai                             |____|'
  76.