[comp.sys.mac.hypercard] XCMD Pascal Link Problem, PLEASE HELP US!

hvirtanen@abo.fi (Harry Virtanen) (05/06/91)

As novice xcmd/xfcn programmers for HyperCard, we have encountered the 
following problem:

We have been working on a complex expert system that has been programmed in
MPW Pascal and that uses HyperCard as the user interface.

Our job has been to improve the systems diagnosis. The person who originally 
programmed the system used FSOPEN, FSCLOSE etc as File i/o commands. The code 
that we on our part have inserted to the system uses "open", "close", "seek" 
etc. When these commands are present we, when linking, encounter the 
following error message(s):

### Link: Error: undefined entry, name:(Error 28) "close"
    referenced from: _CLOSE in file: HD:MPW:Libraries:PLibraries:PasLib.o

The code is divided into several units resided in several folders. The one to 
which we have added "close","open" commands is a unit "diagnosis.p". This unit
does not have an entrypoint. It consists of several procedures  and functions 
used by other units.

The error is encountered, while linking, from a unit (with an entrypoint) that
makes a call to one of the functions in diagnosis.p.

The compiling and linking of the entire system is started by a top level 
makefile which sets the appropriate folders (setdirectory) and then calls for 
the makefile in that folder (buildprogram).

The first one to be built is a library (Lib) in which diagnosis.p is part of.

In the makefile, that builds the library (called FAKSLib) we have the 
following dependency declaration:

   diagnosis f "{FAKSObject}"diagnosis.p.o

   "{FAKSObject}"diagnosis.p.o  f diagnosis.p
			       "{Pinterfaces}"HyperXCmd.p
			       "{XCmdObject}"XcmdLib.o
			       "{FAKSObject}"definitions.p.o
			       "{FAKSObject}"dataBaseAccess.p.o

No link commands are present in this makefile.

Higher up in the same makefile we have:

   Lib	"{FAKSObject}"definition.p.o
	  :	:	:
	  :	:	:
	 "{FAKSObject}"diagnosis.p.o
	  :	:	:
	 -o "{FAKSObject}"FAKSLib.o

In one of the other makefiles that actually links things together (and produces 
the xcmd's) has the following format: this is by the way the unit that causes
the error message while linking,

   FDimproveDiagnosis  ff	"{FAKSObject}"FDimproveDiagnosis.p.o
	Link	"{FAKSObject}"FDimproveDiagnosis.p.o
		"{Libraries}"Interface.o
		"{FAKSObject}"FAKSLib.o
		"{XcmdObject}"XcmdLib.o
		"{PLibraries}"PasLib.o
		"{PLibraries}"HyperXLib.o
		-o "{FAKSLink}Diagnosis commands" -rt XCFN=28412 -sg 
			FDimproveDiagnosis -m ENTRYPOINT

Some people have suggested to enter PasLibIntf in the "uses" command and to 
link with PasLib.o.

Any ideas out there on how to proceed ????????


Harry Virtanen
Abo Akademi University
Turku, Finland