[comp.sys.mac.programmer] ARRRGGH! MPW 3.1 HyperCard XFCN Linkage Errors...

dank@calvin.usc.edu (Dan King) (01/16/91)

[OK, fine!  I'll give up and ask for help on this one, too!]

I've written several XFCNs with MPW 3.0 that work fine.  Today,
however, I tried to recompile the same (exactly the same) code with
MPW 3.1.  The compile worked fine.  The link produced the following
error:
### Link: Error: Data Initialization code is not being called. (Error 57)

I've never seen this before.  The XFCN (actually, the three XFCNs
which all produce this error) is a simple beast that mucks about with
a couple of resources then exits.  No windows/dialogs/menus/or
anything.

Has anybody else seen this before?  Is it documented anywhere?  Any
suggestions for a fix (the code is a little lengthy to post, but I
will if it will help)?

Any help will, as always, be appreciated.

dank

mandel@vax.anes.tulane.edu (Jeff E Mandel MD MS) (01/17/91)

In article <29347@usc> dank@calvin.usc.edu (Dan King) writes:
>
>[OK, fine!  I'll give up and ask for help on this one, too!]
>
>I've written several XFCNs with MPW 3.0 that work fine.  Today,
>however, I tried to recompile the same (exactly the same) code with
>MPW 3.1.  The compile worked fine.  The link produced the following
>error:
>### Link: Error: Data Initialization code is not being called. (Error 57)
>
>Has anybody else seen this before?  Is it documented anywhere?  Any
>suggestions for a fix (the code is a little lengthy to post, but I
>will if it will help)?
>
 The problem is that your code has generated a global reference. The most
likely culprit is a string. Use the -b option to the C compiler, and it should
go away.
 If this is not the problem, then you have to do some sleuthing. Unless you
have insight into where you are generating the problem (in which case, why
would you be calling for help?), you can home in on it by using the dumpObj
tool to examine your object files and see which one is creating the %A5_Init
reference, then work (tediously) back from there.
 Of such character as I have built with MPW, a significant portion has been
from eliminating A5_Init references from C++ code. You too can be so fortunate!

Jeff E Mandel MD MS
Asst. Professor of Anesthesiology
Tulane University School of Medicine
New Orleans, LA

Disclaimer: "I usually put something amusing here, but I'm tapped out"