[luabind] About DYLIB search path
Brought to you by:
arvidn,
daniel_wallin
From: Thales L. R. S. <tl...@gm...> - 2012-04-30 17:49:43
|
I was able to build and use luabind within my applications without problems but I have one question. In order to test LuaBind I created a command line tool using XCode 4.2. I add libluabind.dylib in the "link binaries with" area and add a copy phase in order to copy the dylib to the same directory where the executable resides. Using otool to grab information about the executable dependencies I get the following *LuaBindExample:* * bin/darwin/release/libluabind.dylib (compatibility version 0.0.0, current version 0.0.0)* * /opt/local/lib/liblua.dylib (compatibility version 5.1.0, current version 5.1.4)* * /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)* * /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.11)* My question is why the dylib path for luabind starts with bin/? I copy the dylib file in the executable directory but if I run the program it gives the following error *dyld: Library not loaded: bin/darwin/release/libluabind.dylib* * Referenced from: /Users/tluisrs/Library/Developer/Xcode/DerivedData/LuaBindExamples-fnnpnobfkchkzdemmonixfvtemzl/Build/Products/Debug/./LuaBindExample * * Reason: image not found* *Trace/BPT trap* Which I can understand. I was able to solve this problem exporting the dylib path in the environment variable DYLD_LIBRARY_PATH. But I was trying to create a stand alone "bundle" in order to distribute my application without having to configure the environment every single time. To build luabind I use bjam. I did not find any information about how to change the search path for a dylib within an executable. Does anyone have a clue? Thanks. -- Anyday, anytime. http://www.capimlokura.com.br Thales Luis Rodrigues Sabino TLuisRS |