Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!utcsri!flaps From: flaps@utcsri.UUCP Newsgroups: comp.sys.amiga Subject: Re: Opening a window (really re 'Base' variables) Message-ID: <4811@utcsri.UUCP> Date: Sun, 24-May-87 00:33:19 EDT Article-I.D.: utcsri.4811 Posted: Sun May 24 00:33:19 1987 Date-Received: Sun, 24-May-87 03:07:56 EDT References: <4866@jhunix.UUCP> Reply-To: flaps@utcsri.UUCP (Alan J Rosenthal) Organization: University of Toronto Lines: 44 Summary: I'm posting this because it could be of general interest. In article <4866@jhunix.UUCP> ins_adjb@jhunix.UUCP (Daniel Jay Barrett) writes: >I typed in the example window-opening program on pages 11-12 of the >INTUITION REFERENCE MANUAL, and compiled using Manx 3.20a. The >compilation went fine, but the linker could not find _INTUITIONBASE >defined. When you use OpenLibrary, the result gets stored in a variable which is MYSTERIOUSLY used somehow presumably in conjunction with the window. This should definitely be explained more in the manuals! What is actually happening is that the routines that use it refer to it as an extern, and use it as the base-address for the library. So you must make it a global, exported (not "static"ed) variable, and you must call it exactly the name that it is supposed to be called. If you don't, the linker won't match it up with the externs in the library functions you call, and will give an undefined reference error of some kind. > My exact commands were: > > cc +L win.c > ln win.o -lc ^^ As Paul Higginbottom noted, you should be linking with c32.lib not c.lib if you are compiling +L. This is on the second disk and should be copied onto ram: or wherever your CLIB variable points. But I would advise trying to use the normal 16-bit library as soon as possible after you manage to get your first program working. You should try to declare all external functions returning types other than int and void. For one, this is more important when the number of bytes in the type being returned is different than the number of bytes in an int, which is true in the Manx compiler (and not in Lattice). -- // Alan J Rosenthal // \\ // flaps@csri.toronto.edu, {seismo!utai or utzoo}!utcsri!flaps, \// flaps@toronto on csnet, flaps at utorgpu on bitnet. Kermit - Protocol error