Re: About DYLIB search path
liam mail <[email protected]> Mon, 30 Apr 2012 19:27:18 +0100
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <CAOMMs2RRoVuBy5WURBaziOubzHx8QGHRFW2BKujeetLGT4oq8w@mail.gmail.com> |
On 30 April 2012 18:49, Thales Luis Rodrigues Sabino <[email protected]> wrote: > 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 > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > luabind-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luabind-user > I do not know how to accomplish this with bjam yet this information may help. Using the gcc or xcode you can achieve this by setting the installpath(INSTALL_PATH) which will be prefixed to the dylib or installname (LD_DYLIB_INSTALL_NAME )which is the path an dylib name. If you want to change the name after you have compiled then you should use max_path_install when compiling and change it via the command line tool install_name_tool. Liam ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/