PDA

View Full Version : usr/lib/xxxxx.dylb files?




Cactus Dan
Jun 4, 2012, 10:30 AM
Howdy,

My question is about linking to .dylib files from the directory:
Developer/SDKs/MacOSX10.x.sdk/usr/lib/xxxxx.dylib

... will the compiled application automatically search the hidden directory:
usr/lib/xxxxx.dylib

...on machines that don't have the developer tools installed?

Adios,
Cactus Dan



ScoobyMcDoo
Jun 4, 2012, 10:53 AM
Howdy,

My question is about linking to .dylib files from the directory:
Developer/SDKs/MacOSX10.x.sdk/usr/lib/xxxxx.dylib


That directory does not exist on my mac, and I do have the developer tools installed.

lloyddean
Jun 4, 2012, 11:07 AM
No

Cactus Dan
Jun 4, 2012, 11:11 AM
Howdy,
No
So does that mean I have to link directly to the .dylib file in the hidden folder?

Adios,
Cactus Dan

chown33
Jun 4, 2012, 11:21 AM
Read this article:
http://cocoadev.com/wiki/ApplicationLinking

Pay attention to the concept of install name. Also the significance of @rpath when used in a dylib install name. There are other @names, too. It won't make sense until you know what an install name is.

Then read the man page for dyld (man dyld (http://developer.apple.com/library/mac/#documentation/Darwin/Reference/Manpages/man1/dyld.1.html)).


BTW, you're posting relative pathnames instead of absolute. This is relative:
usr/lib/xxxxx.dylib

this is absolute:
/usr/lib/xxxxx.dylib

The absolute path is absolute, regardless of the working directory. The relative path is relative to current working directory, which may be changed.

http://en.wikipedia.org/wiki/Relative_path
http://en.wikipedia.org/wiki/Working_directory

Cactus Dan
Jun 4, 2012, 11:47 AM
Howdy,
...Read this article:
http://cocoadev.com/wiki/ApplicationLinking
...
AHA! Thanks for that link.
So, the actual install path of the .dylib file in question IS in the hidden folder, according to the terminal output:
otool -D /Developer/SDKs/MacOSX10.5.sdk/usr/lib/libiconv.2.dylib
/Developer/SDKs/MacOSX10.5.sdk/usr/lib/libiconv.2.dylib:
/usr/lib/libiconv.2.dylib
I suspect as much but just wasn't absolutely sure. That terminal command will be added to my list of useful commands.


...BTW, you're posting relative pathnames instead of absolute. This is relative:
usr/lib/xxxxx.dylib

this is absolute:
/usr/lib/xxxxx.dylib

The absolute path is absolute, regardless of the working directory. The relative path is relative to current working directory, which may be changed...
Hehe, yeah that's why I never trust my typing and always drag and drop when I need the correct path. ;)

Thanks again.

Adios,
Cactus Dan

lloyddean
Jun 4, 2012, 12:37 PM
You should also be aware that the '/Developer' folder no longer exists on the latest versions of Xcode.

Cactus Dan
Jun 4, 2012, 01:20 PM
Howdy,
You should also be aware that the '/Developer' folder no longer exists on the latest versions of Xcode.
Well, when you unhide the hidden files and directories, do you have the directory:
/usr/lib/
... showing in the root directory of your HD?

Adios,
Cactus Dan

lloyddean
Jun 4, 2012, 02:17 PM
Yes.

But Apple considers it theirs and it's contents have changed in past versions of the OS.

Cactus Dan
Jun 4, 2012, 02:40 PM
Howdy,
Yes.

But Apple considers it theirs and it's contents have changed in past versions of the OS.
OK, cool. I'm not worried about that because I'm not setting the "Library Search Paths", "Header Search Paths" and "Other Linker Flags" options to that hidden directory. I'll be setting those options to the:
/Developer/SDKs/MacOSX10.x.sdk/usr/lib/libiconv.dylib
...directory, since we've established that the install path of the above directory IS the hidden folder.

Normally I wouldn't even be concerned with linking to an individual library in one of the Mac OS SDKs, except in this situation I'm creating an FBX import/export plugin for an existing application, which seems to have a problem with their c++ plugin API, where the FBX SDK library can't find the libiconv.dylib. So I have to force the directory search by including the paths in the "Library Search Paths", "Header Search Paths" and "Other Linker Flags".

If I use the FBX SDK library in a stand alone application, it has no problem finding the libiconv.dylib library.

Adios,
Cactus Dan