
Signature
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
> > What I don't understand is why Xcode's #import directive can find one of
> > the .h files but not the other. What's the deal with #imported filenames
[quoted text clipped - 22 lines]
> ..." and "Add files ..." items. Same idea though... you want to add the
> framework to your project as a unit, not the individual files inside of it.)
I want just add that depend on which version of SMySQL (dynamic, static,
...) you take perhaps you will have to change either the #import
<SMySQL/SMyQL.h> to #import <SMySQL_bundled/SMySQL.h> or edit the name of
the file. At least it was the case for the last time I used CocoaMySQL.

Signature
Frédéric Testuz
> > What I don't understand is why Xcode's #import directive can find one of
> > the .h files but not the other. What's the deal with #imported filenames
[quoted text clipped - 5 lines]
> extension, and the second part tells it what file to look for in that
> framework's Headers/ subdirectory.
[...]
> Just add the CocoaMySQL framework to your project. Choose the
> "Project/Add to Project ..." menu item, and add the CocoaMySQL.framework
> directory, *not* the individual files inside that directory. That will
> not only add the framework's Headers/ subdir to the preprocessor search
> path, it will also link the dynamic library that's in the framework to
> your app.
That's what's puzzling. In my project, in the folder marked
"CocoaMySQL->Frameworks->Linked Frameworks" of the "Groups & Files"
pane, both Cocoa.framework and SMySQL.framework are included. I can
clearly see both
"...Frameworks->Linked Frameworks->Cocoa.framework->Headers->Cocoa.h"
and
"...Frameworks->Linked Frameworks->SMySQL.framework->Headers->SMySQL.h"
listed in the pane. Clicking either one of the files displays the source
code in the .h file. Yet when I tried to compile a module containing
#import <Cocoa/Cocoa.h>
#import <SMySQL/SMySQL.h>
The compiler/preprocessor accepts the first #import but not the second.
Changing the line to
#import "SMySQL/SMySQL.h"
doesn't seem to make a difference.
I'm guessing that the only thing different is a search path somewhere
letting the compiler find the Cocoa framework in /System/Library but not
the SMySQL framework in ~/Development/..../<myproject>, despite the IDE
being able to find both files.
BTW, this is the exact set of project files unstuffed from the
CocoaMySQL source code download, so would think all the project
components are complete and in their correct relative locations.
Van

Signature
Van Bagnol / n p c o m p l e t e at bagnol dot com / c r l at bagnol dot com
...enjoys Theatre / Windsurfing / Skydiving / Mountain Biking
...feels "parang lumalakad ako soo loob ng panaginip"
...thinks "An Error is Not a Mistake ... Unless You Refuse to Correct It"
Glenn Andreas - 28 Sep 2004 17:55 GMT
> > > What I don't understand is why Xcode's #import directive can find one of
> > > the .h files but not the other. What's the deal with #imported filenames
[quoted text clipped - 37 lines]
> CocoaMySQL source code download, so would think all the project
> components are complete and in their correct relative locations.
When you "add library" it doesn't update the include search path (and,
in fact, if you've installed OS SDK support, it actually looks in
/Developer/(where ever the OS SDK live) rather than /System/Library for
frameworks as well).
Normally, libraries live somewhere that the default include search path
already covers, so there is no problem, but since you're using one that
isn't, you'll need to manually update it (somewhere in the build
settings panel).
Van Bagnol - 29 Sep 2004 00:14 GMT
> > > > What I don't understand is why Xcode's #import directive can
> > > > find one of the .h files but not the other. What's the deal
[quoted text clipped - 10 lines]
> > > "Project/Add to Project ..." menu item, and add the CocoaMySQL.framework
> > > directory, *not* the individual files inside that directory.
[snip]
> > That's what's puzzling. In my project, in the folder marked
> > "CocoaMySQL->Frameworks->Linked Frameworks" of the "Groups & Files"
[quoted text clipped - 3 lines]
> > and
> > "...Frameworks->Linked Frameworks->SMySQL.framework->Headers->SMySQL.h"
[snip]
> > I'm guessing that the only thing different is a search path somewhere
> > letting the compiler find the Cocoa framework in /System/Library but not
[quoted text clipped - 14 lines]
> isn't, you'll need to manually update it (somewhere in the build
> settings panel).
Well, I manually added the SMySQL.framework to the project (so now
there's two of them) which finally got the app to compile, build (albeit
with some duplicate symbol warnings), and run.
However, it's warning me that certain directories don't exist, e.g.,
/Users/ide/developer (apparently from the original uploaded
configuration). I can't seem to find where those directories are
specified. I do seem to remember a instance when I was able to examine
the project's plists (I recall seeing the names of those nonexistent
directories listed somewhere) but I can't figure how to get back to it
again.
Van

Signature
Van Bagnol / n p c o m p l e t e at bagnol dot com / c r l at bagnol dot com
...enjoys Theatre / Windsurfing / Skydiving / Mountain Biking
...feels "parang lumalakad ako soo loob ng panaginip"
...thinks "An Error is Not a Mistake ... Unless You Refuse to Correct It"
Heath Raftery - 29 Sep 2004 01:22 GMT
>> > What I don't understand is why Xcode's #import directive can find one of
>> > the .h files but not the other. What's the deal with #imported filenames
[quoted text clipped - 12 lines]
>> path, it will also link the dynamic library that's in the framework to
>> your app.
> That's what's puzzling. In my project, in the folder marked
> "CocoaMySQL->Frameworks->Linked Frameworks" of the "Groups & Files"
[quoted text clipped - 11 lines]
> #import "SMySQL/SMySQL.h"
> doesn't seem to make a difference.
> I'm guessing that the only thing different is a search path somewhere
> letting the compiler find the Cocoa framework in /System/Library but not
> the SMySQL framework in ~/Development/..../<myproject>, despite the IDE
> being able to find both files.
This was mostly answered elsewhere, but I did want to reiterate a possible
source of frustration. I had almost the same problem as you over the last
couple of days, except the preprocessor was happy with
#import <Security/Authorization.h>
but not
#import <Security/AuthorizationDB.h>
#import <SecurityInterface/SFAuthorizationView.h>
the latter of which was the one I was actually after. This was despite the
fact that I had added all the frameworks, and could clearly see the
headers listed under the frameworks. In a moment of sudden clarity, I
realised this was because I was targetting the OS X 10.2.8 SDK, and the
headers I was after did not exist under
/Developer/SDKs/MacOSX10.2.8/System/Library/Frameworks/
So just a word of warning to all, which I hope saves someone some time -
make sure the frameworks you add are available in the OS you are
targetting!

Signature
*--------------------------------------------------------*
| ^Nothing is foolproof to a sufficiently talented fool^ |
| Heath Raftery, HRSoftWorks _\|/_ |
*______________________________________m_('.')_m_________*