Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > irrKlang
Getting started on Xcode

harkathmaker
Registered User
Quote
2009-06-12 20:51:41

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).



harkathmaker
Registered User
Quote
2009-06-12 22:31:59

Solved... I didn't put the file in the project folder! >.>


harkathmaker
Registered User
Quote
2009-06-19 00:13:29

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?


niko
Moderator
Quote
2009-06-19 10:52:18

You could simply copy the .dylib into that folder (/Users/Shared/IrrKlang_test/build/Debug/). Or install it into your lib directory.


harkathmaker
Registered User
Quote
2009-06-19 21:18:34

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.


niko
Moderator
Quote
2009-06-22 16:38:50

Are you creating a bundle (.app) for your application? You can put all .dylibs in that bundle, in this way it should work.


anchor
Registered User
Quote
2009-10-09 22:18:29

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.


anchor
Registered User
Quote
2009-10-10 13:05:10

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)


philhassey
Guest
Quote
2009-11-12 20:53:42

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)


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "In?ernational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact