Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I'm trying to use irrKlang with Irrlicht in a project. I have the irrlicht portion working, but there are some problems when I try to link all the resources for irrKlang. I have linked the include folder and imported libirrklang.dylib into my project, but even with an empty main() function it always returns 5. In Xcode I'm using a Carbon Application target, MainMenu.nib... not sure if that would affect the problem. I have run a couple of the examples and they work fine. Please help! Edit: I'm going through the debug log and it says this: dyld: Library not loaded: /usr/local/lib/libirrklang.dylib
Referenced from: /Users/Shared/Empty_Xcode2/build/Debug/HelloWorld.app/Contents/MacOS/HelloWorld Reason: image not found The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to signal 5 (SIGTRAP). |
||||
|
Solved... I didn't put the file in the project folder! >.> |
||||
|
I have a second problem now. Although putting the .dylib in the project folder lets it run for debugging, the application itself doesn't run. In other words I can "Build and Go" from Xcode but can't open the application it creates. The terminal says this when it exits: dyld: Library not loaded: /usr/local/lib/libirrklang.dylib Referenced from: /Users/Shared/IrrKlang_test/build/Debug/Carbon_console Reason: image not found Trace/BPT trap How can I make a link between the .dylib and the application? |
||||
|
You could simply copy the .dylib into that folder (/Users/Shared/IrrKlang_test/build/Debug/). Or install it into your lib directory. |
||||
|
I tried putting it in the directory. The problem is the application doesn't look there... it looks instead in the location /usr/local/lib. In the examples the directory is changed so it is the same folder as the app, but this method doesn't work for Applications, only the shell tool. So now where I'm stuck is how to somehow set the directories where my application is to search for its libraries. That should probably solve the problem. |
||||
|
Are you creating a bundle (.app) for your application? You can put all .dylibs in that bundle, in this way it should work. |
||||
|
i have same problem. the app doesn't load the libirrklang.dylib. the dylib copied into the the app's folder. but i got always the same error as harkathmaker wrote. i dont know why do all example load the dylib, and my app doesn't. |
||||
|
ok, its solved with the "install_name_tool" tool. i found it in the example xcode project... now everything working fine. (except the inverted mouse cursor Y movement in full screen with irrlicht) |
||||
|
Here's a longer explanation on how to use the install_name_tool for a app bundle style project: 1. add in the irrklang.dynlib to the project Frameworks. 2. and to the Targets>GameName>Copy Frameworks Into .app Bundle> 3. When you try to compile it gives this error :: dyld: Library not loaded: /usr/local/lib/libirrklang.dylib 4. To fix this you must add a script phase to correct the binary so it knows where to find your dylib. A. Targets>GameName>Right Click: add New Build Phase :: Run Script Phase B. Get Info on the Run Script Phase and put this in for the script: C. install_name_tool -change /usr/local/lib/libirrklang.dylib @executable_path/../Frameworks/libirrklang.dylib "$TARGET_BUILD_DIR/$PRODUCT_NAME.app/Contents/MacOS/$PRODUCT_NAME" D. And for the Input files put: $(BUILT_PRODUCTS_DIR)/$(PRODUCT_NAME) |
|