home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!agate!stanford.edu!sun-barr!sh.wide!wnoc-tyo-news!scslwide!wsgw!wsservra!daemon
- From: c2xlai@kocrsv01.delcoelect.com (Larry A. Ice)
- Newsgroups: fj.mail-lists.x-window
- Subject: Re: Translation Manager example problem
- Message-ID: <1992Nov19.113552.8772@sm.sony.co.jp>
- Date: 19 Nov 92 11:35:52 GMT
- Sender: daemon@sm.sony.co.jp (The devil himself)
- Distribution: fj
- Organization: Delco Electronics Corp.
- Lines: 74
- Approved: michael@sm.sony.co.jp
-
- Date: 16 Nov 92 14:14:17 GMT
- Message-Id: <1992Nov16.141417.28774@kocrsv01.delcoelect.com>
- Newsgroups: comp.windows.x
- References: <1992Nov12.162841.4505@kocrsv01.delcoelect.com>
- Sender: xpert-request@expo.lcs.mit.edu
-
-
- In article <1992Nov12.162841.4505@kocrsv01.delcoelect.com>, c2xlai@kocrsv01.delcoelect.com (Larry A. Ice) writes:
- >
- > I am working on the example programs in Doug Young's book:
- > 'The X Window System, Programming and Applications with Xt
- > (OSF/Motif Edition)'. In chapter two, 'Programming with the
- > Xt Intrinsics' in section 2.4.5, 'Using the Translation
- > Manager', there is an example of the memo program which uses
- > the Translation Manager to bind the key sequence <Key>Q to the
- > ArmAndActivate action procedure.
- >
- > extern void quit();
- >
- > static XtActionsRec actionsTable [] = {
- > {"bye", quit},
- > };
- > static char defaultTranslations[] = "<Key>Q: bye()";
- >
- > main(argc, argv)
- > int argc;
- > char *argv[];
- > {
- > ************************************************************
- >
- > Here is the definition of quit():
- >
- > #include <X11/Intrinsic.h>
- >
- > static void quit(w, event, params, num_params)
- > Widget w;
- > XEvent *event;
- > String *params;
- > Cardinal *num_params;
- > {
- > XtCloseDisplay(XtDisplay(w));
- > exit(0);
- > }
- > ***********************************************************
- >
- > THE PROBLEM occurs when I attempt to build the program:
- >
- > [311] koptsw32: make
- > rm -f memo
- > cc -o memo memo.o quit.o -O -lXm -lXt -lX11 -lXs -L/users/c2xlai/xwin
- > ld: Undefined symbol
- > _quit
- > *** Error code 2
- > make: Fatal error: Command failed for target `memo'
- >
- > What's wrong with this code?
- >
-
- OOPS! I declared quit with:
-
- static void quit(w, event, params, num_params)
-
- By declaring quit static, I kept it hidden from memo and the
- linker was unable to resolve the reference. Removing the
- static declaration allowed the linker to resolve the reference
- successfully.
-
-
-
- --
- .+----+ Larry Ice (317)451-0890 GM: 8-322-0890 .+----+
- +----+'| Software Engineer Mail: CT40A +----+'|
- | | | Domain: c2xlai@kocrsv01.delcoelect.com | | |
- |____|' UUCP: deaes!c2xlai |____|'
-