LWM: ENSURE-OBJC-INITIALIZED causes SEGV / Creating a pure Cocoa app
Hello, I'm trying to create a "pure" Cocoa app (i.e. one which uses NSApplication and its event loop) with LWM 4.4.5 on Mac OS X 10.4.1. Has anyone out there tried something like this with success? So far all my attempts have resulted in an app which dies while calling (objc:ensure-objc-initialized ...) Error: Signal : segmentation violation(11) Type :b for backtrace, :c <option number> to proceed, or :? for other options CL-USER 1 : 1 > :b Call to ERROR Call to FLI::TYPE-CELL-GET-E-TYPE-INFO Call to FLI::GET-FOREIGN-STRUCTURE-DESCRIPTOR Call to FLI::FOREIGN-SLOT-VALUE-NO-KEYWORDS Call to FLI::BASIC-FOREIGN-SLOT-VALUE Call to OBJC::MAKE-OBJC-CLASS-IVARS Call to OBJC::MAKE-OBJC-CLASS Call to OBJC::INIT-OBJC-CLASS Call to (SUBFUNCTION (LABELS OBJC::CHECK-INIT-OBJC-CLASS) OBJC::INIT- ALL-OBJC-CLASSES) Call to (SUBFUNCTION (LABELS OBJC::CHECK-INIT-OBJC-CLASS) OBJC::INIT- ALL-OBJC-CLASSES) Call to OBJC::INIT-ALL-OBJC-CLASSES Call to OBJC:ENSURE-OBJC-INITIALIZED Call to COCOA-APPLICATION:START-APPLICATION Call to DELIVERY::MAYBE-RYB-TOP-LEVEL CL-USER 2 : 1 > The only code which I'm loading into LispWorks is: cocoa-application.lisp ============================== ;;; -*- Mode: Lisp; -*- (defpackage :cocoa-application (:use :common-lisp) (:export #:*frameworks-to-initialize* #:start-application)) (in-package :cocoa-application) (defparameter *frameworks-to-initialize* '("/System/Library/Frameworks/Foundation.framework/Foundation" "/System/Library/Frameworks/Cocoa.framework/Cocoa")) (defun start-application () ;; initialize objc runtime (objc:ensure-objc-initialized :modules *frameworks-to-initialize*)) =============================== Then in order to deliver the application I'm using the following script and command: deliver.lisp ======================== (in-package "CL-USER") (load-all-patches) (load (sys:example-file "configuration/macos-application-bundle.lisp")) (compile-file "cocoa-application.lisp") (load "cocoa-application") (deliver 'cocoa-application:start-application (write-macos-application-bundle "~/Test" :template-bundle "/Applications/LispWorks 4.4.5/Library/lib/ 4-4-0-0/examples/delivery/macos/templates/FullApplication.app/") 0 :interface nil :multiprocessing nil) ========================== % /Applications/LispWorks 4.4.5/LispWorks.app/Contents/MacOS/ lispworks-4-4-5-darwin -siteinit - -init deliver.lisp My expectation was that the resulting app would simply start up and then exit cleanly. Does anyone know what additional initialization LispWorks does normally? Any ideas on why objc:ensure-objc- initialized is dying? Any help would be much appreciated. Thanks, -greg _______________________________________________________ Greg Wuller greg@wuller.com _______________________________________________________