Hello,
I had to remake the project file to change from a bundle to a dynamic library. Having done that, and those three steps you mentioned, I am having another problem, that I write here in case you know the answer.
I am trying to run unit tests using the OCUnit framework under Xcode 2.5 on Tiger. I have a target to build the code, and another target to build a test bundle. I am linking both the code and the unit test bundle with other two dylib's that the code depends on. The code targets depend on those two other projects that generate the dynamic libs, and the test bundle depends on the code target. In the linking build step on both targets I added the dylib's of those two other projects. When I build both targets everything runs fine. When the test bundle target runs the script to run the tests at the end it complains about the other projects dylib's not being loaded:
2008-01-31 11:20:12.575 otest[2104] *** -[NSBundle load]: Error loading code /Users/dlsa/code/Su-render/trunk/rendering-lib.subproj/FileToDBImportExport.subproj/build/Debug/TesterBundle.octest/Contents/MacOS/TesterBundle for bundle /Users/dlsa/code/Su-render/trunk/rendering-lib.subproj/FileToDBImportExport.subproj/build/Debug/TesterBundle.octest, error code 4 (link edit error code 4, error number 0 (Library not loaded: /usr/local/lib/model-elements.dylib
It is searching for the depended project's dylib in the installation path. How can I change this ?
Many thanks.
On Jan 30, 2008, at 5:11 PM, Chris Espinosa wrote:
On Jan 30, 2008, at 3:40 AM, Daniel Luis dos Santos wrote: i have a project that was created as a bundle. I then read the documentation on bundles and figured out that it wasn't the kind of product that I wanted. I wanted a dynamic library. I then changed the mach-o type to dynamic library in the target's build settings.
Then I created another target that depends on the first target. This one uses a class compiled from the first target. I added the first target as a dependency of the second. I get an error when linking the second target saying that it can't find the symbol for the class used from the first target.
I was expecting the target dependency would do this. I am wondering if it is because of the product type. In the build settings for the first target, the general pane still shows bundle as the product type. Can this be changed ?
If you have a dynamic library target and a target that's a client of that library, you need to perform three separate, independent, but required steps:
1) Add the library's target to your client target dependencies, to make sure it's up to date at link time 2) Add the library itself to your client target, to actually link to it 3) Add the library itself to a Copy Bundle Resources or Copy Files build phase, so your client finds the dylib at runtime
Yes, it would be nice if Xcode did all three at once.
Chris
|