Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building and using a .jnilib that uses .dylib's



You might be able to get this to work with install_name_tool. See the man page for details.

If that doesn't work, there are alternatives -- launching your application with a shell script that sets DYLD_LIBRARY_PATH, for example -- but those aren't much fun.

-Eric

On Sep 9, 2003, at 10:58 AM, John Lussmyer wrote:

I finally got back to this. (Vacation! :-)

As far as I can tell from the info I found about @executable_path, it has to
be applied to the .dylib when it is created.
The problem is that the .dylib's are provided by a 3rd party. I don't
create them.

Any other suggestions for getting my .jnilib to find the .dylib's?

-----Original Message-----
From: Eric Albert [mailto:email@hidden]
Sent: Wednesday, September 03, 2003 1:06 AM
To: John Lussmyer
Cc: email@hidden
Subject: Re: building and using a .jnilib that uses .dylib's

At 9:29 AM -0700 9/2/03, John Lussmyer wrote:
Okay, I've built a .jnilib that uses a set of .dylib's. It all works
except
for one little problem.
All the .dylib's have to be in the same folder as the Application.App
bundle. If I put them in the folder with the .jnilib, the app doesn't
work.
It seems to be unable to find the .dylib's.

So, is there some setting I can do to make the .jnilib find the .dylib's in
the same folder?

I've never tried this, but you should be able to set the install name
of the dylibs to something relative to @executable_path that'll point
to the directory containing the dylibs. Unfortunately, I can't find
much documentation for @executable_path. Here's a page to get you
started; search for "@executable_path" to find the interesting bits:
<http://developer.apple.com/documentation/DeveloperTools/ ProjectBuilder/Proj
ectBuilder.help/Contents/Resources/English.lproj/Frameworks/ chapter_19_secti
on_3.html>

What I think you'd want to do is to add a linker flag for each of
your dylibs of "-Wl,-install_name,@executable_path/../Resources/Java"
(if the dylibs are in your application package's Resources/Java
directory). Again, this is just a guess, but it *should* work....

Hope this helps,
Eric
_______________________________________________
projectbuilder-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/projectbuilder-users
Do not post admin requests to the list. They will be ignored.

References: 
 >RE: building and using a .jnilib that uses .dylib's (From: John Lussmyer <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.