Xcode 3.25, Mac OS X 10.6, 10.5 compatibility required.
I have a Mac Xcode project, which mixes Cocoa and C/C++. Some legacy modules require a C-only header.
I created a C header file: myCTypes.h
I wish to use a CGPoint in that header.
Compiling generates an error: CGPoint is not defined. OK, no problem, so I'll just:
#include: "<CoreGraphics/CoreGraphics.h>"
Unfortunately, I get this:
error: CoreGraphics/CoreGraphics.h: No such file or directory
Hmm. OK, so I'd best add the framework. But if I right-click on the frameworks group within Xcode, and try to "Add an existing framework", CoreGraphics does not show up in the list. Grr.
So I try to add it manually, navigating my way to System/Library/Frameworks. Nup, not in there either.
So I look in the 10.5 SDK paths, and once again, there's a lot of CoreXXX frameworks in there, but no CoreGraphics.framework.
Can someone please tell me what I'm doing wrong here? What do I need to use CGGraphics in that header? Cheers.
EDIT
This was solved by:
#include <Carbon/Carbon.h>
(But if anyone wants to tell me if this is good practice or not, please feel free. Cheers.)
Core Graphics is part of Application Services, so that's the header you should include:
#include <ApplicationServices/ApplicationServices.h>
You can include Carbon.h if you want, but its total length after preprocessing is very long, so you should include it only when you absolutely have to (e.g., for Carbon Events hotkey stuff) in order to keep your build times down.
Well i know this topic is super old but i wanted to answer pqnet`s question in the comments (can't comment on it because I have less than 50 rep points :( ) now to the point: Yes, today anyway, you can add only core graphics framework if you like.
Click on your project in the project navigation pane; build phases; link binary with libraries. Then, chose coreGraphics; then click add.
Thats all, enjoy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With