[comp.sys.mac.programmer] Help needed in MPW C

fang@physics.phy.duke.edu (Fang Zhong) (10/26/90)

	I got Link Errors as following:

### Link: Error: Undefined entry, name: (Error 28) "SFGetfile"
  Referenced from: stdfil in file: Az_processing.c.o
### Link: Error: Undefined entry, name: (Error 28) "SFPutfile"
  Referenced from: stdfil in file: Az_processing.c.o

My make-file is as following:

OBJECTS = Az_processing.c.o

Az_processing DD Az_processing.make {OBJECTS}
	Link -f -srt -ad 4 -ss 1000000 -w -t APPL -c FANG 6
		{OBJECTS} 6
		"{CLibraries}"Clib881.o 6
		"{CLibraries}"CSANELib881.o 6
		"{CLibraries}"Math881.o 6
		#"{CLibraries}"Complex881.o 6
		"{CLibraries}"StdClib.o 6
		"{CLibraries}"CInterface.o 6
		"{CLibraries}"CRuntime.o 6
		"{Libraries}"Interface.o 6
		-o Az_processing
Az_processing.c.o D Az_processing.make Az_processing.c
	 C  -mc68020 -elems881 Az_processing.c

I do not know what I missed such that the Linker could not find SFGetFile.
Thanks in advance for any hints.

Fang

--
	Fang Zhong				1-919-684-8247
	Duke University Dept. of Physics	fang@phy.duke.edu
	Durham, N.C.      27706			

jeffh@HyperMail.apple.com (Jeff Holcomb) (10/30/90)

My guess is that you need to capitalize SFGetFile and SFPutFile correctly 
in your source code.  MPW C and the Linker are case sensitive, and the 
error messages were:

> ### Link: Error: Undefined entry, name: (Error 28) "SFGetfile"
>   Referenced from: stdfil in file: Az_processing.c.o
> ### Link: Error: Undefined entry, name: (Error 28) "SFPutfile"
>   Referenced from: stdfil in file: Az_processing.c.o

Note that the 'f' is lower case, and should be upper case.

I hope this helps,
Jeff

___________________________________________________________________________
Jeff Holcomb                 Internet: jeffh@HyperMail.apple.com
                            AppleLink: jeffh@HyperMail.apple.com@INTERNET#
                                GEnie: A2.JEFFH
Contracting for Apple ATG       Voice: (408) 974-0841

         My opinions are not necessarily those of Apple.  :-P
___________________________________________________________________________

marshall@sdd.hp.com (Marshall Clow) (10/30/90)

In article <21718@duke.cs.duke.edu> fang@physics.phy.duke.edu (Fang Zhong) writes:
>
>	I got Link Errors as following:
>
>### Link: Error: Undefined entry, name: (Error 28) "SFGetfile"
>  Referenced from: stdfil in file: Az_processing.c.o
>### Link: Error: Undefined entry, name: (Error 28) "SFPutfile"
>  Referenced from: stdfil in file: Az_processing.c.o
>
>My make-file is as following:
[ make file lines deleted ]

	Try adding an "#include <Packages.h>" to the list at the top
of your source file. What is happening is that the compiler is deciding 
that SFGetFile is a procedure that it hasn't seen before. However, the
name of the procedure that you want to call is really SFGETFILE, which is
why the linker can't find it in the libraries.
	In Packages.h, the procedure is decalred as:
pascal void SFGetFile(Point where,... and so on ... );
The "pascal" keyword means that the name is all upper case, as well as
switching the order that the parameters are pushed onto the stack, as
well as some other minor details.

>
>--
>	Fang Zhong				1-919-684-8247
>	Duke University Dept. of Physics	fang@phy.duke.edu
>	Durham, N.C.      27706			

Marshall Clow
marshall@sdd.hp.com