views:

69

answers:

1

I'm trying to build a .dylib in Xcode. Currently the .dylib builds, but when I drag the .dylib into another project and try to #import one of the headers (Seeker.h) in the .dylib, I get this error:

*: No such file or directory
Seeker.h: No such file or directory

The project is available as an Xcode project here.

I can confirm the header is indeed in a path alongside the .dylib once built, but as for what to do with it I have no idea. My only experience with .dylib files is frameworks built into Mac OS X, like libsqlite3.dylib, which works perfectly. All the tutorials I can find on .dylib files does not cover how to use them with Xcode in a sensible manner; all of them rely either on complex scripts or machine-dependent configuration which will not work for us.

So basically I need a start-to-finish step-by-step process that successfully builds the .dylib and successfully includes it in another Xcode project in a way that's not dependent on changing build settings for different users. In other words, a way that just works and that will work when we distribute both projects to members of our team.

+1  A: 

Dylibs don't carry headers: they're brainless executable files. Built-in frameworks have their headers in known locations, like /usr/include, which makes them globally available. What you're looking for is probably a framework.

Frameworks are packages that contain a dynamic library and header files, so once you link with the framework you can import the headers it has. It can also carry other resources such as images and sounds.

I suggest you read the Framework Programming Guide for more informations.

zneak
Well, now I've created the framework and everything's crazy... I built it in Xcode 4 but it won't work in either 3 or 4; I recreated it in 3 using a new project and it won't work in 3 but it'll work in 4... ugh. I've actually had [problems with frameworks before](http://cl.ly/2rcS) that were never resolved. WHY are there no good framework tutorials that actually work? We'll probably never know... in any case, now I'm stuck with NO functioning framework OR dylib...
jfm429
I did create a quick demo of the issue available [here](http://cl.ly/2s6B) - this one has some major issues that I can't figure out. If someone can just figure out how to get that working, it would be a big help...
jfm429
Well, now I have this issue: http://cl.ly/2sDe I've uploaded a copy of the test project [here](http://cl.ly/2rlW). Basically everything seems to be working (headers and all) but the Image Not Found error comes up. I've used a few frameworks (and had the header issues) but I never saw this one before...
jfm429
Okay, I've got the important one [working](http://cl.ly/2s3L) (!) but I still want to know what's going on with that sample project with the Image Not Found error, especially since it should be working. Also, if you're interested in what this actually is, here's the [project](http://cl.ly/2rsL) on SourceForge, though nothing's uploaded yet. Basically it's an object oriented SQLite wrapper written in C++.
jfm429