Any CodeWarrior users running with Panther?
Any CodeWarrior users running with Panther?
- Subject: Any CodeWarrior users running with Panther?
- From: John Stiles <email@hidden>
- Date: Wed, 6 Aug 2003 18:31:14 -0700
I've been writing a Cocoa app with CodeWarrior Pro 8.3 and I'm running
into some issues with changed framework/system #includes when I use
Panther 7B21. Apologies if this has been covered before but I didn't
see it in the list archives. I made sure not to discuss anything new or
secret :)
The first issue, which I was able to work around, was that the 10.3
headers assume that wchar_t is a native type when you are building C++
code, unlike 10.2 which does not make this assumption and has a typedef
for wchar_t whether you are building C code or C++ code. (In my case,
I'm using cpp files and turning on the "Enable Objective C" checkbox,
because my project uses a lot of C++ classes as well as Objective C to
interface with AppKit.) When I was building my app on 10.2, I was able
to simply disable CodeWarrior's "Enable wchar_t support" option and
everything worked. In 10.3, Apple isn't typedef'ing wchar_t since my
code is in cpp files, so any function declarations which use wchar_t
(like in wctype.h) fail. If I just re-enable the "wchar_t support"
checkbox, this gets the app building again, but then I can't build
under 10.2 any more. So I ended up putting the following code in our
prefix file:
// Mac OS X 10.2.x and 10.3.x handle wchar_t's quite differently. In
order
// to keep this project building under both OS versions, we need to fix
up
// wchar_t's here.
#ifndef _BSD_WCHAR_T_DEFINED_
#define _BSD_WCHAR_T_DEFINED_
#define wchar_t int
#endif
(I would normally use a typedef, but at this point in our prefix, the
precompiled header has yet to be included, and you can't typedef
something and then #include a precompiled header. Long story, trust me
:) )
So that was a little skanky, but it was solvable. However, I'm stumped
on another problem that cropped up. It seems that any files which
#import <Cocoa/Cocoa.h> generate errors in NSObjectController.h, about
the line:
@protocol NSMenuItem;
Apparently CodeWarrior thinks this is a redefinition (even though it
just looks like a forward declaration to me) and flags it as an error.
I don't know how to work around this one, unfortunately. Even the
built-in Metrowerks Cocoa precompiled headers (MacOS X
Support/CocoaHeaders/CocoaHeaders.mcp) fail to build in 10.3, so it
can't be anything in my code.
Has anyone else tackled this problem? Is there a workaround, or should
I just keep coding in 10.2 for now?
(I appreciate that Apple is investing all this effort into Xcode, but I
do wish they would at least do the bare minimum necessary to let
CodeWarrior users continue to get work done. I'm sure this is just an
oversight, but I'd think putting even a simple "Hello World"
CodeWarrior project in the testing checklists would shake out this sort
of problem.)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.