Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!aplcen!haven!udel!princeton!phoenix!djlinse From: djlinse@phoenix.Princeton.EDU (Dennis Linse) Newsgroups: comp.sys.next Subject: Lisp <-> Objective C Summary: external object declaration from C? Message-ID: <11996@phoenix.Princeton.EDU> Date: 6 Dec 89 22:24:01 GMT Reply-To: djlinse@phoenix.Princeton.EDU (Dennis Linse) Distribution: na Organization: Princeton Unversity, Princeton, NJ Lines: 43 An associate is trying to use the Allegro Common Lisp - Objective C interface provided on the NeXT. Nearly everything works fine, except (you knew that was coming) when trying to access an objective-c class defined in Lisp while in C. This is confusing to describe. Let me see if an example helps. The lisp looks something like ------- (require :objc) (require :foreign) (use-package :excl) (use-package :objc) (use-package :appkit) (use-package :foreign-functions) (def-objc-class Expert (Object) ()) (def-objc-method (determineControllerCommands Expert :float) () 10.0) (print-class Expert) (load "SimulatorApp.o") ----------- Included in SimulatorApp.m is a call to Expert (i.e. [Expert new]). When this is loaded into Lisp, the class is created and printed out just fine. The loading of the .o file begins, but then fails with an error something like "Symbol .objc_class_name_Expert undefined". He was only able to get this far by creating an .h file with an @interface to a dummy Expert class. I can see how this is incorrect, but I can't find any other way to fix it. What appears to be needed is an extern declaration for the class, so that the Objective-C can be compiled (without the dummy @interface, it won't even compile because Expert is unknown). Any pointers to the correct documentation, examples, or solutions would be greatly appreciated. Thanks! Dennis Linse (djlinse@phoenix.princeton.edu)