From: Jong Gyun Lim
Subject: Lisp (KCL) and Motif
Date: 
Message-ID: <CMM.0.90.2.742498451.lim@cs.columbia.edu>
Hi,

my medium sized expert system written in Lisp runs fine in KCL
along with X/Motif GUI programs written in C also in KCL
on SparcStations.

However, I get the following weird error messages if I run
the same setting on HP 800 series machines.

If anybody out there could spare me a minute and give me a clue
on what these error messages might mean, it would mean a world of help to
me because I must make it to work soon...

     (If you are an X/Motif or C guru but don't know what KCL is, KCL
      is an implementation of CommonLisp that can interface C and Lisp
      functions relatively smoothly because KCL runs lisp functions by
      always translating them into C functions first.  KCL can compile
      both C and Lisp functions into .o files and then link them together.)


Depending on the version of X/Motif  (X11R4,Motif1.1 or X11R5,Motif1.2,
respectively), my error message is either

...
Warning: translation table syntax error: Modifier or '<' expected
Bus error (core dumped)

		or
...
Error: No realize class procedure defined


If you have read this far, and still willing to help, here is the detail.  
(Sorry to waste the bandwidth, but it is urgent... thanks for understanding...)
------------------------------------------------------------------------------


		       TEST 1 (With X11R4, Motif1.1) 
		      *******************************	

 --- FILE test.c ---

/* Motif test() function */
int test()
{
  int i;
        static char *text[] = {"field1","field2","field3","field4"};
        static int length[5] = {10,10,10,10};
        static char *argv[] = {"text"};
        int y = 1;

        printf("TEST1\n");
 -----> toplevel = XtInitialize("text","TEXT", NULL, 0, &y, (char **)0);
        printf("TEST2\n");
        text_bboard = XtCreateManagedWidget("text_bb"
			,xmBulletinBoardWidgetClass ,toplevel,args,0);
        printf("TEST3\n");
        for (i=0; i < XtNumber(text); i++){
                text_input[i] = XtCreateManagedWidget(text[i],
				       xmTextWidgetClass,text_bboard,args,0);
                XmTextSetMaxLength(text_input[i],length[i]);
                XtAddEventHandler(text_input[i],ButtonReleaseMask,False,
					Text_Check1CB,i);
                XtAddEventHandler(text_input[i],KeyPressMask,False,
					Text_CheckCB,i);
        }
        printf("TEST4\n");
        XtRealizeWidget(toplevel);
        printf("TEST5\n");
        XtMainLoop();
}



 --- FILE def_c_func.lsp ---

;; Define C function called "test" as a lisp function "choi"
(clines "#include \"test.c\"")
(defentry choi () (int "test"))
 


 --- FILE test-gui.lsp ---

;; Compile GUI module and link with Motif.
 (load "def_c_func.lsp")
 (setf COMPILER::*CC* "cc -I/usr/include/X11R4 -I/usr/include/Motif1.1")
 (compile-file "def_c_func.lsp")
 (defparameter *libs* " -L /usr/lib/Motif1.1 -L /usr/lib/X11R4" )
 (si::faslink "def_c_func.o"  (concatenate 'string "-x " *libs* 
				"  -lXm -lXt -lX11 -lc"))


 --- Transcript of execution ---
$ kcl
AKCL (Austin Kyoto Common Lisp)  Version(1.615) Fri Jul  9 10:10:33 KST 1993
Contains Enhancements by W. Schelter
Loading init.lsp
Finished loading init.lsp

>(load "test-gui")
Loading test-gui.lsp
Loading def_c_func.lsp
Finished loading def_c_func.lsp
Compiling def_c_func.lsp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
Finished compiling def_c_func.lsp.entry is offset at 1c80(8064)start 
 address -T 4011e000 done link
Finished loading test-gui.lsp
T

>(choi)
TEST1
Warning: translation table syntax error: Modifier or '<' expected
Bus error (core dumped)



		       TEST 2 (With X11R5, Motif1.2) 
		      *******************************	

Only difference is the file test-gui.lsp.

 --- FILE test-gui.lsp ---

;; Compile GUI module and link with Motif.
 (load "def_c_func.lsp")
 (setf COMPILER::*CC* "cc -I/usr/include/X11R5 -I/usr/include/Motif1.2")
 (compile-file "def_c_func.lsp")
 (defparameter *libs* " -L /usr/lib/Motif1.2 -L /usr/lib/X11R5" )
 (si::faslink "def_c_func.o"  (concatenate 'string "-x " *libs* 
				"  -lXm -lXt -lX11 -lc"))


 --- Transcript of execution ---
$ kcl
AKCL (Austin Kyoto Common Lisp)  Version(1.615) Fri Jul  9 10:10:33 KST 1993
Contains Enhancements by W. Schelter
Loading init.lsp
Finished loading init.lsp

>(load "test-gui")
Loading test-gui.lsp
Loading def_c_func.lsp
Finished loading def_c_func.lsp
Compiling def_c_func.lsp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=0 (No runtime error checking), Space=0, Speed=3
Finished compiling def_c_func.lsp.entry is offset at 11870(8064)start 
 address -T 4011e000 done link
Finished loading test-gui.lsp
T

>(choi)
TEST1
Error: No realize class procedure defined



--
Jong-Gyun Lim                           212) 939-7113   704 Schapiro Building
Department of Computer Science				Columbia University