From: walker@twix.unx.sas.com (Doug Walker)
Subject: Re: Even more questions on SAS/C 6.0
Originator: walker@twix.unx.sas.com
Date: Thu, 15 Oct 1992 12:53:23 GMT
Organization: SAS Institute Inc.


In article <1992Oct13.163213.2487@brandonu.ca>, brycerw@brandonu.ca writes:
|> I've just installed my version of SAS/6.0, and read the manuals, and other good
|> things like that.  Got a few questions:
|> 1.)	I used GadToolsBox to layout windows.  Because I used his neat
|> 	file-type gadget, I need to include the file boopsi.o, which he
|> 	supplies.  I've included this file in the Libraries/Objects list
|> 	under Linker Options, in SCoptions.  For some reason, the one
|> 	routine, initGet() which is located in the boopsi.o file cannot be
|> 	found for linking.  I've declared 'extern Class *initGet(void)', as
|> 	should be required.  When the linker asks me for a define value for
|> 	@initGet, I simply enter initGet, and it works.  Why can't the linker
|> 	find it on its own?

When you compile a function with registerized parameters, it adds an
at sign (@) to the beginning of the name.  Functions that take their
parameters on the stack start with an underscore (_) instead.  What's
happening is that whoever compiled boopsi.o compiled it with stack
parameters, and you have set the PARMS=REG option.

The solution is to declare a prototype for initGet() and any other
routines defined in boopsi.o that use the __stdargs keyword:

   void __stdargs func(int, double, other parameters);

This will tell the compiler that even though you have the PARMS=REG
option on, this particular function is to be called with stack
parameters instead.  Note that if initGet takes any parameters,
your program will probably crash if you simply type _initGet when
it asks you for the symbol.

|> 2.)	I ran scsetup on the directory containing the project I've been working
|> 	on, using 5.10a.  I also set up SCoptions to values I'm wanting.  I
|> 	never once declared what .c files (all of them in the directory) I
|> 	wanted as part of the project, but it has somehow magically able to
|> 	figure out I wanted all .c files.  How?  Where would I put this in,
|> 	in SCoptions (if I do that there), and how do I add in more .c files
|> 	later as the project grows?

If there is a file called "makefile" or "smakefile" in the directory, the Build
icon will invoke SMake on that file, which will cause it to build its default
target.  This is the recommended way to work with larger projects, because you
can have it automatically recompile your .c files when the .h files change.

For smaller projects, you don't need a makefile.  If the Build icon can't find
a makefile in the current directory, it invokes the SC command with the
following options:

   SC #?.c LINK ERRORREXX MODIFIED

This effectively tells SC to compile all the files in the directory that end
in .c that have been modified since the last time they were compiled, and link
all the .o files together.  (ERRORREXX just tells it to send messages to the
message browser.)

|> By the way, congrats to the SAS developers on a very nicely made product,
|> though I've already found a bug or two in the editor.

Thanks for the compliment.  We're working on a bug-fix patch;  I hope you
have reported your editor problems so we can fix them in the patch.  (The
editor did take second place to the code generator and optimizers during
development!)

|> 
|> Robert Bryce
|> BRYCERW@BrandonU.CA

-- 
  *****
=*|_o_o|\\=====Doug Walker, Software Distiller====== BBS: (919)460-7430 =
 *|. o.| ||                                          1200/2400/9600 Dual
  | o  |//     For all you do, this bug's for you!
  ====== 
usenet: walker@unx.sas.com                            bix: djwalker 
Any opinions expressed are mine, not those of SAS Institute, Inc.

Newsgroups: comp.sys.amiga.programmer