|
Hi, Thanks for the detailed response! 1. so I opted for the .so suffix, to maintain Lua(Unix) rather than Apple portability (and an unmodified Lua core). 2. Thank you. I modified my application build flags to -DLUA_USE_DLOPEN -DLUA_USE_POSIX. 3. Actually I'm not using gluax any more, that was copied from an older project. Right now I'm trying to embed just an unmodified Lua core to ensure library portability. 4. Yes, this was no doubt the real issue. Thank you very much for your project settings - my library is working finally, though some of my project settings are different since I use the recommended -undefined dynamic_lookup and don't specify a bundle loader (for portability again). I'm not getting the forced lib prefix problem here. Since this is probably quite useful for the archives, I'll describe in detail what I did. FWIW this is using Xcode 2.4 on OX 10.4. I started with BSD->Dynamic Library, and here are the customized settings (All Build Configurations): // or wherever lua includes are, e.g. /usr/local/include Header Search Paths = $(PROJECT_DIR)/lua // this makes with -bundle Mach-O Type = Bundle // ... doesn't work for -bundle Compatibility Version = [ ] Current Library Version = [ ] // this means we don't need to link against the lua core nor a dynamic library/framework... Lua symbols can be found in the embedding application: Other Linker Flags = -undefined dynamic_lookup // this ensures the output is modname.so: Product Name = modname Executable Prefix = Executable Extension = so Wrapper Extension = // this was advised as necessary, but I'm not sure why: Perform Single-Obejct Prelink = [x] // stripping symbols: (strip -x) Strip Style = Non-Global Symbols Strip Debug Symbols During Copy = [x] Generate Debug Symbols = [ ] // other settings: Precompiled Headers Cache Path = Prebinding = [ ] Zerolink = [ ] Scan All Source Files for Includes = [x] Or in other words: SHARED_PRECOMPS_DIR = HEADER_SEARCH_PATHS = $(PROJECT_DIR)/lua SCAN_ALL_SOURCE_FILES_FOR_INCLUDES = YES MACH_O_TYPE = mh_bundle PREBINDING = NO ZERO_LINK = NO DYLIB_CURRENT_VERSION = DYLIB_COMPATIBILITY_VERSION = OTHER_LDFLAGS = -undefined dynamic_lookup GENERATE_MASTER_OBJECT_FILE = YES PRODUCT_NAME = testmod EXECUTABLE_PREFIX = EXECUTABLE_EXTENSION = so INSTALL_PATH = /usr/local/lib STRIP_STYLE = non-global COPY_PHASE_STRIP = YES GCC_GENERATE_DEBUGGING_SYMBOLS = NO The part in your Xcode project about 'custom executable' regards loading the Lua runtime to test (debug) your library. In my case, I'm embedding Lua into an application so I can use that application as my runtime executable. The Debug configuration is only necessary for debugging; the distributed library should be built with Release. On Oct 30, 2007, at 1:05 AM, Asko Kauppi wrote:
grrr waaa www.grahamwakefield.net |