views:

26

answers:

1

Hi!

I am using Xcode and, after some struggling, it is compiling my dynamic libraries okie dokie for now.

My kinda-problem now is that I need to use those libs with another project, that is an executable.

I would like that Xcode, after compiling my libs, copy them to the executable folder, or, better, copy the libs to a system directory, where they would be loaded without having to compile(thus copying) the libs over again

There is a Install Directory in the project's settings, the default is /usr/local/lib, but I don't even have a folder called local at /usr (I tried to reach it through the terminal), so I guess this isn't working at all...

any help is appreciated!

Thanks,
Jonathan

A: 

Perhaps the "Copy Files" build phase can do this for you. Select "Absolute Path" and then maybe "only when installing".

Ah, so here's the documentation you want (first section after intro, "Build Locations"):

http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/210-Building_Products/building.html

Though if you want the libraries installed in the "install location" even when doing debug builds, then the "Copy Files" build phase might end up being better.

Haven't done this myself but those are the things that come to mind directly.

Dad
I tried this but the compiler can't copy the file, it says permission denied from what I looked at the logs... Maybe I can copy the lib to a folder one level up from the project and set the OS to search for libs there? Do you know how to do this? I don't =[
Jonathan
Yes, you need admin privs to write to system directories.you can put dylibs inside an application bundle, so you do it that way. Each application would have its own copy of the dylib.
Dad
Used frameworks instead of the dylib alone, and then used the copy files to add the frameworks to the executable's place
Jonathan