home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!spool.mu.edu!hri.com!ukma!cs.widener.edu!dsinc!ub!acsu.buffalo.edu!qizeng
- From: qizeng@acsu.buffalo.edu (Qi Y. Zeng)
- Newsgroups: comp.windows.x.intrinsics
- Subject: problem with intrinsics.h
- Message-ID: <BzMsG8.8vL@acsu.buffalo.edu>
- Date: 21 Dec 92 22:43:20 GMT
- Sender: nntp@acsu.buffalo.edu
- Organization: UB
- Lines: 101
- Nntp-Posting-Host: lictor.acsu.buffalo.edu
-
- Dear Netters:
- I have run an X_window program but I have found
- some problems there.
- This program is from the book "X window System--
- Programming and applications with Xt" by Douglas A.
- Young.
- I send the program and the error message to you
- and hope you can help me to solve this problem.
- With best regards and many thanks.
-
- Qizeng
-
- I type the following to run the program:
-
- cc memo.c concat.c -lX11 -L/util/X11/lib
-
-
- The error message is as follows:
-
-
- memo.c: 2: Can't find include file X11/Instrinsic.h
- /util3/X11/include/Xw/Xw.h: 80: XtRTranslationTable redefined
- /util3/X11/include/Xw/Xw.h: 302: XtNinsertPosition redefined
- /util3/X11/include/Xw/Xw.h: 307: XtNselectionArray redefined
- /util3/X11/include/Xw/Xw.h: 308: XtNtextSource redefined
- /util3/X11/include/Xw/Xw.h: 309: XtNselection redefined
- /util3/X11/include/Xw/Xw.h: 313: XtNeditType redefined
- /util3/X11/include/Xw/Xw.h: 314: XtNfile redefined
- /util3/X11/include/Xw/Xw.h: 315: XtNstring redefined
- /util3/X11/include/Xw/Xw.h: 316: XtNlength redefined
- /util3/X11/include/Xw/Xw.h: 317: XtNfont redefined
- concat.c:
-
-
- he program is as follows:
-
- memo.c is
-
- #include<X11/Instrinsic.h>
- #include<X11/StringDefs.h>
- #include</util3/X11/include/Xw/Xw.h>
- #include</util3/X11/include/Xw/SText.h>
- #include<stdio.h>
-
- extern char *concat_args();
- main(argc,argv)
-
- int argc;
- char *argv[];
-
- {
- Widget toplevel,msg_widget;
- Arg wargs[];
- int n;
- char *message;
-
- toplevel=XtInitialize(argv[0],"memo",NULL,0,&argc,argv);
-
- n=0;
- if((message=concat_args(argc,argv))!=NULL){
- XtSetArg(wargs[n],XtNstring,message);n++;
- }
-
- msg_widget=XtCreatManageWidget("message",XwstatictextWidgetClass,toplevel,
- wargs,n);
-
- XtRealizeWidget(toplevel);
- XtMainLoop();
- }
-
-
- concat.c is:
-
-
- #include<stdio.h>
- char *concat_args(n,words)
- int n;
- char *words[];
- {
- char *buffer;
- int i,len=0;
-
- if(n<=1)
- return("");
- for(i=1;i<n;i++)
- len+=strlen(words[i]);
- len+=(n-1);
- buffer=(char *)malloc(len+1);
- if(buffer==NULL){
- fprint(stderr,"out\n");
- exit(1);
- }
- buffer[0]='\0';
-
- for(i=1;i<n;i++){
- if(i>1)
- strcat(buffer," ");
- strcat(buffer,words[i]);
- }
- return (buffer);
- }
-