Xcode 4

External developers... This forum's for you!

Xcode 4

Postby bmartin » Sun Mar 20, 2011 5:50 am

Well, it seems like apple has broken external development when you use Xcode 4. First of all, it looks like they have changed the Templates format. I found the Templates directory at: /Developer/Library/Xcode/Templates/Project Templates/Mac/

But after dropping the SC template folder in this directory they do not show up in the new project gallery dialog window.

Secondly, after opening and resetting up an older project I build the .bundle external and when SC tries to load the external I get an error SuperTalk Error Number 230: There does not appear to be a SuperCard external in the specified bundle. The SCExternalType key in the bundle's Info.plist file may not be set correctly.
I checked that key and it is set to XFcn, as it should be and was before.

I'm using SuperCard 4.6.3 still so maybe these issues are fixed in SC 4.7?

One other request: Can we get Objective-C templates for externals? I realize SC is an old beast and can't technically use Objective-C data types natively, but if the templates could handle the conversions in the backend it would make writing new externals so much easier. We could use existing Apple Documentation without worrying about converting NSStrings to cStrings or NSNumbers to ints or deal with a handle because it would be an object. :) I know I 'm not asking for much.

Thanks,
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 4

Postby codegreen » Sun Mar 20, 2011 10:12 am

bmartin wrote:Well, it seems like apple has broken external development when you use Xcode 4.
...
I'm using SuperCard 4.6.3 still so maybe these issues are fixed in SC 4.7?

Not yet.

One other request: Can we get Objective-C templates for externals?

The reason there's no templates for Obj-C is that we don't recommend using it unless you really understand what you're doing. Cocoa was designed with the idea that nothing would ever get unloaded during the life of a process, and thus using it in externals is dangerous unless you either don't use anything that might be referenced somehow after the project containing your external gets closed (even something as simple as CFSTR("") is potentially fatal) or you load the external directly from the bundle and make sure you don't unload it again.

-Mark
codegreen
 
Posts: 1545
Joined: Mon Jul 14, 2008 11:03 pm

Re: Xcode 4

Postby bmartin » Mon Mar 21, 2011 3:55 pm

Ok thanks Mark. Still wishing for the cocoa based templates, but looks like I'll have to wait.
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 4

Postby 1nperson0z » Mon Mar 21, 2011 6:45 pm

Can anyone give some guidance as to what the underlying problem is here? Is XCode 4 only allowing Cocoa templates, or is there some other issue?

Ian B
MacBook Pro 2.4Ghz i7 8Gb 10.11.3
1nperson0z
 
Posts: 79
Joined: Wed Jul 09, 2008 3:31 pm
Location: Blue Mountains Australia

Re: Xcode 4

Postby bmartin » Tue Mar 22, 2011 1:43 am

Mark could clarify, but it looks like Xcone 4 has changed the way it builds bundles maybe something in the settings, I just know the bundles are not recognized by SC as externals.
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 4

Postby bmartin » Tue Mar 22, 2011 3:09 am

Part of the problem is the bundles location seems to have changed. The bundle that is where it use to be is nothing but a shell. The MACOS resource folder is missing. I found the real bundle located in ~/Library/Developer/Xcode/DerivedData/externalsName-hsldfklshflkhslfdklskflkhs/Build/Products/DEbug/ExternalsName.bundle

However I am now getting a Mach-O error 232 Unable to link Mach-O external
Bruce Martin

Mac Os 10.6.3
2.8 Ghz Intel Core 2 Duo
4GB 1067 MHz DDR3
User avatar
bmartin
 
Posts: 149
Joined: Mon Jul 07, 2008 7:26 am
Location: Stroudsburg, PA

Re: Xcode 4

Postby codegreen » Tue Mar 22, 2011 9:06 am

1nperson0z wrote:Can anyone give some guidance as to what the underlying problem is here? Is XCode 4 only allowing Cocoa templates, or is there some other issue?

For XCmd development, right now Xcode 4 is basically just a big bag of hurt.

Though there are other issues, the immediate problem is that the format of project templates has changed, and is now both undocumented and subject to change without notice (as Apple apparently does not intend that end users shall be able to create their own project templates or IB plugins from now on). It's no longer flat either, but involves a form of inheritance among XML files spread across multiple folders.

In addition, with XC4 it's no longer possible to build PPC code or to develop for less than 10.5 (and even that's discouraged).

And aside from the technical constraints, IMHO it's also a UI crime on a par with the infamous round mouse.

If you want to use XC4 to develop externals for SuperCard, start filing your bugs with Apple. But I wouldn't hold your breath while waiting for them to be addressed, because Apple's clearly on a mission here to make development for OS versions prior to Snow Leopard more trouble than it's worth.

-Mark
codegreen
 
Posts: 1545
Joined: Mon Jul 14, 2008 11:03 pm

Re: Xcode 4

Postby sctell » Tue Mar 22, 2011 10:28 am

AND

you have to pay for the privilege
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby sctell » Wed May 25, 2011 11:02 am

codegreen wrote:If you want to use XC4 to develop externals for SuperCard, start filing your bugs with Apple. But I wouldn't hold your breath while waiting for them to be addressed, because Apple's clearly on a mission here to make development for OS versions prior to Snow Leopard more trouble than it's worth.


Is it the SC development teams intention to make the creation of externals with XCode 4 possible.

I would presume by this time that you have spoken with your contacts at Apple and decided whether or not it is possible.

If it is not possible then please advise what is the future?

I presume at some stage Apple will stop upgrading Xcode 3 and it will slowly fade away.

They also it would appear have intentions to drop Carbon altogether.

Will carbon apps run in Lion?

It would be nice to know your plans for the future of SC and I don't mean the detail.

I have to say that I have not upgraded from 4.6.3 because of this as I am becoming a little concerned that perhaps you may throw the towel in just like Mark Alldrit with Facespan and would not want to waste (no pun intended) hard earned cash with no future in prospect.

I am sure I cannot be the only one with concerns. It would be a shame because SC is a great tool despite becoming a little long in the tooth.
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby witness » Sat Jun 25, 2011 11:50 pm

sctell wrote:I presume at some stage Apple will stop upgrading Xcode 3 and it will slowly fade away.


Yes, the same way as they did it with Project Builder, Xcode 1.x and Xcode 2.x.

sctell wrote:They also it would appear have intentions to drop Carbon altogether.


Yes, they announced that Carbon would not be going 64 bit and are urging everyone to move to Cocoa.

sctell wrote:Will carbon apps run in Lion?


They do. My guess is they will keep it that way at least for the duration of 10.7, and then make it optional in 10.8 like they did for Rosetta and Java. But that's just my guess.

sctell wrote:I have to say that I have not upgraded from 4.6.3 because of this as I am becoming a little concerned that perhaps you may throw the towel in just like Mark Alldrit with Facespan and would not want to waste (no pun intended) hard earned cash with no future in prospect.


I can't speak for Mark, but don't you agree that this is kind of a self-fulfilling prophecy? If Mark put work into SC 4.7, then saw few people upgrade, that would actually *cause* him to throw in the towel. If many people upgrade, that serves as encouragement that there is still demand and that he should continue to put in the effort into keeping SuperCard relevant.

And incidentally, it will also give him the money needed to keep on the lights :-)
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby sctell » Sun Jun 26, 2011 10:15 am

witness wrote:I can't speak for Mark, but don't you agree that this is kind of a self-fulfilling prophecy? If Mark put work into SC 4.7, then saw few people upgrade, that would actually *cause* him to throw in the towel. If many people upgrade, that serves as encouragement that there is still demand and that he should continue to put in the effort into keeping SuperCard relevant.


You may well be correct but...

Commitment is not a one way street.

Perhaps a statement outlining the future for SC and it's users would clarify things.

SC are not Apple and the "secrecy because we don't want to give the game away to our competitors" does not really hold water.

There really is only two options for SC as presented.

1. Change to Cocoa (in a broad sense).
2. Go out of business.

All I want to know is which they are choosing.

I would hate to think I had upgraded to be dumped. I had asked before and been told basically take it or leave it.
Not a good communication policy.

The opposition in Revolution (or whatever it's called this week) seem to be concentrating on a multi platform offering.

RealBasic have started a Cocoa version but the last time I read are having serious difficulties.

Facespan as I mentioned has bitten the dust.

ASOC, works well in my opinion but if you are going for ASOC you may as well do Cocoa Objective-C.

Supercard has a real opportunity.

Communication is the key here.

Communication/Commitment gives those wavering a reason to upgrade.

No communication gives those wavering reason to believe that the commitment is not there.

SC is not a religion but a business product trying to earn money for it's developers and businesses that do not innovate and move forward fail.

I don't have the numbers, only SC's developers know how many have upgraded as the years go by and whether they are losing customers.
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby sctell » Sun Jun 26, 2011 10:19 am

witness wrote:sctell wrote:
Will carbon apps run in Lion?


They do. My guess is they will keep it that way at least for the duration of 10.7, and then make it optional in 10.8 like they did for Rosetta and Java. But that's just my guess.


My concern here is that if the current SC will run in Lion and your suggestion is correct then a Cocoa version of SC may be 2 years away?
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby witness » Fri Jul 22, 2011 4:29 pm

Hi,

I managed to get an XFcn compiling under Xcode 4.1 (the version for Lion that's available for free from the app store right now) thanks to generous help from an Apple employee. You can find the source code at http://github.com/uliwitness/objc You will also need to grab http://github.com/uliwitness/UliKit to get SCParamBlock, which this uses.

Here are a few notes on what I had to do:

- I manually created a new project based on the template. I didn't take the time to convert the templates to the new format.
- I changed the "Base SDK" of the project -- the templates say "10.5", but the oldest OS Xcode 4 can build for is 10.6.
- Xcode 4 is very anal about the C standard and doesn't like someone defining a main() function like XCmds need them. So I renamed it to ExternalMain() and added a little _asm("main") magic to tell the compiler to treat this as the main function.

I hope this helps those of you eager to move to Lion.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby sctell » Sat Jul 23, 2011 10:28 am

HI,

Tried compiling objcstr example in Xcode 4.1 and got this warning:

#warning Strings.h is not available on Mac OS X

What has caused this to be generated Xcode 4 is not pointing me anywhere?
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby witness » Sat Jul 23, 2011 3:19 pm

sctell wrote:Tried compiling objcstr example in Xcode 4.1 and got this warning:

#warning Strings.h is not available on Mac OS X

What has caused this to be generated Xcode 4 is not pointing me anywhere?


Yeah, for some reason including <Carbon/Carbon.h> seems to cause this. I think it's accidentally catching FlatCarbon or so, but it doesn't seem to have any effect (maybe because I'm not making any calls to stuff in Strings.h anyway).
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby sctell » Sun Jul 24, 2011 10:02 am

Also,

We still need

NSApplicationLoad();

don't we?

All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby sctell » Sun Jul 24, 2011 12:38 pm

Hi,

I have been tying to recompile one of my externals with Xcode 4 and I get this error.

implicit declaration of function 'GetWindowPtr' is invalid in C99


Any ideas please?


All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby witness » Sun Jul 24, 2011 2:47 pm

sctell wrote:We still need

NSApplicationLoad();

don't we?


Strictly spoken, that's only needed when you're doing GUI (i.e. using AppKit), but you're right, to be really useful, my objc XFcn should probably include a way to call that, too.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby witness » Sun Jul 24, 2011 2:49 pm

sctell wrote:I have been tying to recompile one of my externals with Xcode 4 and I get this error.

implicit declaration of function 'GetWindowPtr' is invalid in C99


Any ideas please?


Ah, I think I found it. It's the same reason as the Strings.h error message, I think: Just remove the Header Search Paths entry for FlatCarbon from the build settings. Apparently it grabs those headers when Carbon/Carbon.h tries to include the actual Carbon headers, which breaks the Carbon framework.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby sctell » Mon Jul 25, 2011 1:04 am

Hi Uli,

That has not worked for me.

Throws up even more errors.

I have gotten confused so can't post anything concrete. Will get back later today.

All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby sctell » Mon Jul 25, 2011 7:24 am

Hi Uli,

Here is a blow by blow account of my failed efforts thus far.


Here is the code inserted in your objc project as a test.


Code: Select all
   OSStatus status = noErr;
   Str255 SCWindDescriptor;
   NSString *windDescriptor = [sParamBlock parameterAtIndex:1];
   WindowRef    tSCWindowRef;
   const char *cStr = [windDescriptor cStringUsingEncoding:NSMacOSRomanStringEncoding];
   c2pstrcpy(SCWindDescriptor, cStr);
   status = GetWindowPtr(inParamBlock,SCWindDescriptor,&tSCWindowRef);


The implicit declaration error is I believe because GetWindowPtr is in InternalsToolbox_472.h

So I include the header file and the library in the project and put an include statement at the top of main.

It now says SuperWASTE_472.h file not found I presume because this is included with others in InternalsToolbox_472.h

I now presume I have to add to the user search path pointing to the SuperCard folder that contains the libraries and headers.

When I go there I note that always search user paths is no. I set it to yes.

Build failed, same error.

I add the following search path

/Users/Terry/Downloads/uliwitness-objc-8619fbd/SuperCard

Build failed same error

Getting confused and desperate by now.

Thought I would add SuperWASTE_472.h to the project.

added it

build failed with 20 errors, Too many errors, stopping now in the log.

Here is the error list:

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1150:2: error: unknown type name 'PenState' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1401:3: error: unknown type name 'JustStyleCode' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1403:36: error: unknown type name 'JustStyleCode' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1405:36: error: unknown type name 'JustStyleCode' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1406:38:{1406:37-1406:38}: warning: type specifier missing, defaults to 'int' [-Wimplicit-int,3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1406:16:{1406:1-1406:8}: warning: type specifier missing, defaults to 'int' [-Wimplicit-int,3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1406:36: error: function cannot return function type 'int (const char *, SInt32, SInt32, SInt32, Fixed *, SInt32 *, WEHandle)' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1484:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1484:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1484:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1493:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1493:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1493:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1503:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1503:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1503:5: error: use of undeclared identifier 'JustStyleCode' [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1761:9: error: unknown type name 'WELineBreakProcPtr'; did you mean 'WEWordBreakProcPtr'? [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1877:3: error: unknown type name 'JustStyleCode' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:2501:43: error: unknown type name 'WELineBreakProcPtr'; did you mean 'WEWordBreakProcPtr'? [3]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:2550:94: error: unknown type name 'JustStyleCode' [1]

/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:2552:139: error: unknown type name 'JustStyleCode' [1]

fatal error: too many errors emitted, stopping now [-ferror-limit=]


Help!!!!!!!!!!!!

All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby witness » Mon Jul 25, 2011 9:28 am

sctell wrote:The implicit declaration error is I believe because GetWindowPtr is in InternalsToolbox_472.h

So I include the header file and the library in the project and put an include statement at the top of main.

It now says SuperWASTE_472.h file not found I presume because this is included with others in InternalsToolbox_472.h

I now presume I have to add to the user search path pointing to the SuperCard folder that contains the libraries and headers.


I just dragged the header and library into the project. That automatically adds the search paths.

sctell wrote:
/Users/Terry/Downloads/uliwitness-objc-8619fbd/objc/../SuperCard/SuperWASTE_472.h:1150:2: error: unknown type name 'PenState' [1]


That's a Quickdraw data type. It seems Apple has removed most of Quickdraw from the 10.7 SDK. The only way to easily fix that is to switch the project's SDK setting (under Build Settings) to 10.6.

You may also have to change some of the includes. The headers still use Classic-style includes of system headers, which should be replaced with framework-style includes like <Carbon/Carbon.h>, <QuickTime/QuickTime.h> etc.
Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are Everywhere..."
http://www.zathras.de
User avatar
witness
 
Posts: 55
Joined: Thu Jul 17, 2008 2:24 pm

Re: Xcode 4

Postby sctell » Mon Jul 25, 2011 10:21 am

Hi Uli,

Once again, thanks for your help. I have managed to get it to compile with no issues.

Restarted to get down the actions taken to get it to compile in Xcode 4.1.

Here is a summary of actions taken:

Dragged these files into project:

InternalsToolbox_472.h
SuperXCmd.h
libInternalsToolbox_472.a
libSuperXCmd.a

Changed Base SDK under Architectures to 10.6

After I dragged the files above into the project it did not add the path into Header search paths. I had to add it manually.

When building it advised some preprocessor directives in the header files were incorrect and offered to fix them.
I accepted the offer.

The project compiled with no errors and with no reference to strings.h.

I will now try to compile a complete external and see if it works with SC.

A little advice please with regard to using this project as a template for future use.

I have heard templates are difficult in Xcode 4?

Would it be safe to use this project and rename it?

I believe if you click at objc at the top of the navigator you can rename the project.

Is that reliable for this purpose?


All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby sctell » Mon Jul 25, 2011 11:02 am

Hi,

I can confirm that having recompiled an external that contains an overlay window linked to a SC window it seems to be functioning correctly.


All the best

Terry
sctell
 
Posts: 1143
Joined: Sun Jul 06, 2008 10:41 am

Re: Xcode 4

Postby Dan_Kelleher » Mon Jul 25, 2011 12:47 pm

Terry,
With Uli's kind help you made a lot of rapid progress on that.
That's good to see - thank you for keeping list members informed.
-Dan
Daniel.Kelleher@umassmed.edu
SC4.7.3 OSX 10.7.2 Mac Pro
User avatar
Dan_Kelleher
 
Posts: 438
Joined: Sun Jul 06, 2008 2:45 pm
Location: Worcester (wouster as in would) Massachusetts USA

Next

Return to Xcode and the Internals Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron