28 April 2013, 22:20 | #1 |
Registered User
Join Date: Jan 2007
Location: Vancouver Area, Canada
Posts: 136
|
SAS C tutorial?
I'm a complete beginner to SAS C; how do I get from there, to "Hello World!"? Thanks.
|
28 April 2013, 22:36 | #2 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quick tutorial:
Download and install the most up to date SAS/C: https://www.dropbox.com/s/rt23fhty36...sc658.lha?dl=1 Open your SAS/C drawer and the C drawer and run scsetup. Enter f.ex ram:hw to create a new empty project. Open up your ram:hw drawer and click on edit and type in Hello World: Code:
#include <stdio.h> int main() { puts("Hello, world!"); return 0; } If you want to work from the command line instead then you can compile your program with: Code:
sc hello.c LINK Last edited by Leffmann; 21 December 2016 at 20:35. |
28 April 2013, 23:33 | #3 |
Registered User
Join Date: Jan 2007
Location: Vancouver Area, Canada
Posts: 136
|
Thanks, it works.
"If you give a mouse a SAS C tutorial..." What does "Declaration in statement block" mean, and how do I declare a character array (or does it have strings?) Thanks. Edit: Actually, is there a manual/help guide somewhere? |
29 April 2013, 12:11 | #4 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
SAS/C manuals in text format here:
https://www.dropbox.com/s/5358oxk2dt...tches.zip?dl=1 You also have some quick references in AmigaGuide format in SASC/Help. They don't teach C programming or how to program AmigaOS, just how to use SAS/C. Last edited by Leffmann; 21 December 2016 at 20:37. |
12 June 2013, 00:36 | #5 |
Zone Friend
Join Date: May 2006
Location: France
Posts: 1,801
|
Last edited by kamelito; 19 July 2017 at 07:55. |
18 June 2016, 11:18 | #6 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,322
|
Quote:
|
|
18 June 2016, 13:16 | #7 |
Registered User
Join Date: Dec 2015
Location: Binningen/Switzerland
Age: 58
Posts: 8
|
|
18 July 2017, 23:25 | #8 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
trying to build something with sasc, all the time gives me some link or resolve errors,
this makes me mad - why do things start allways this way first it want me to create o/sas-c-classic and bin/sas-c-classic, next this, for example: Quote:
|
|
18 July 2017, 23:53 | #9 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
The source code (slib4.c) seems to have the problems and missing a main().
|
19 July 2017, 00:13 | #10 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
initially i was about to compile a lightwave plugin, demscape, this gave similiar errors, so i was about to try the examples in the sdk and i got same errors. the example with the errors listed above, is in demscape.lha -> sdk/source/ the demscape plugin src is in the main folder. maybe you can build it Last edited by emufan; 21 July 2017 at 21:46. |
|
19 July 2017, 01:01 | #11 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Go to SDK/source dir, open smakefile in an editor
Code:
# # Server library and startup module -- SAS/C makefile # UINC = /include/ ULIB = /lib/ CFLAGS = smalldata cpu=68020 SFLAGS = $(CFLAGS) define RELEASE opt nostkchk IDIR $(UINC) type smake It builds cleanly after adding the include directory. |
19 July 2017, 01:46 | #12 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
thanks for your help, but it does fail the same way.
Quote:
those damn temp folder (o/ ... bin/ ... ) on it's own. maybe my install is all crap or the author should have been using this compiler on it's own , at least once. i dont get it. |
|
19 July 2017, 02:27 | #13 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
you are calling smake, right? From inside the "SDK/source" folder, right?
|
19 July 2017, 14:35 | #14 | ||
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
Quote:
and now it works, after i extracted my old archive over the SC: installation. - i dont get it. but this makes the linking work, without "Enter a DEFINE value" messages. i have no idea what i have destroyed in the old install, since it did work last time, I build the toasterless software. now i'm about the compile the demscape plugin, lets see how this works thnx. #1) it does build the plugin, but i get some undefined variables at the end, have to look into it :/ the stupid bin/sas-c-classic o/sas-c-classic folder thing i could fix: there is a ENVARC:sc/SCOPTIONS files, here are those path configs listed. #2) sc produce all kind of stupid errors, just because you have set a wrong include path. the compiler gave me a "non matching or overloaded function" error - sort of experience, until i "fixed" the default include path to sc:include in the smakefile ... #3) maybe you can help here again: scan.cc Code:
int x; int startx = (int)ceil(MIN(x1,x2)); int endx = (int)floor(MAX(x1,x2)); if (startx > endx) return; Code:
Undefined symbols First Referenced @floor__Fd File 'scan.o' Enter a DEFINE value for @floor__Fd (default ___stub): #4) hmm, floor and ceil is listed in some math libs (ffp sing doub), i guess a link lib is missing. #5) i have no clue which scm* lib i have to add, or which math*.h i have to include. the demscape.lnk file says: Code:
FROM sc:lib/serv_s.o "quadedge.o"+"hfield.o"+"stuff.o"+"Basic.o"+"simplfield.o"+"heap.o"+"scan.o"+"demscape.o" TO "demscape.p" LIB sc:lib/server.lib LIB:scm881.lib LIB:sc.lib LIB:amiga.lib Code:
CFLAGS = cpu=68020 math=68881 opt nostkchk idir=$(UINC) idir=cxxinclude: Code:
Undefined symbols First Referenced @floor__Fd File 'scan.o' Enter a DEFINE value for @floor__Fd (default ___stub): Code:
Undefined symbols First Referenced @floor__Fd File 'scan.o' Enter a DEFINE value for @floor__Fd (default ___stub): @exit__Fi File 'hfield.o' Enter a DEFINE value for @exit__Fi (default ___stub): @qsort__FPvUiUiPFPCvPCv_i File 'scan.o' Enter a DEFINE value for @qsort__FPvUiUiPFPCvPCv_i (default ___stub): @mrand48__Fv File 'quadedge.o' Enter a DEFINE value for @mrand48__Fv (default ___stub): @abort__Fv File 'Basic.o' Enter a DEFINE value for @abort__Fv (default ___stub): @sqrt__Fd File 'quadedge.o' Enter a DEFINE value for @sqrt__Fd (default ___stub): @ceil__Fd File 'scan.o' Enter a DEFINE value for @ceil__Fd (default ___stub): @__builtin_memcpy__FPvPCvUi File 'simplfield.o' Enter a DEFINE value for @__builtin_memcpy__FPvPCvUi (default ___stub): @fabs__Fd File 'quadedge.o' Enter a DEFINE value for @fabs__Fd (default ___stub): in SCOPTIONS file you can add BATCH - from manual: Quote:
Last edited by emufan; 20 July 2017 at 01:24. |
||
21 July 2017, 14:12 | #15 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
after using the BATCH option in SCOPTIONS, i get the stub requester
when using the plugin. so this workaround does work. but it leaves the plugin non working. so is there an option or an additional lib I have to link in, to make it build without the "Undefined symbols" compiler request? Last edited by emufan; 21 July 2017 at 21:46. |
21 July 2017, 15:32 | #16 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
Check demscape.zip in the zone.
fixed smakefile, a few minor changes in scan.cc and sdk/include/splug.h in order to compile . I've deleted the *.o, kept the demscape.p which I guess is the plugin. Ignore .uaem files (or delete them) |
21 July 2017, 21:06 | #17 |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
just tested, it does now open the gui within modeler. thanks alot.
i'll have a look at the changes, wonder what you have fixed. #1) found the fixes. I can build the plugin now aswell. thnx again #2) it does really work, very cool Last edited by emufan; 21 July 2017 at 21:49. |
21 July 2017, 22:06 | #18 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
cool
|
21 July 2017, 22:09 | #19 | |
Registered User
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
|
indeed. i think the original version was compiled with an older sdk,
so it didnt work with LW5. this is now fixed read this: Quote:
#1) the intel version comes with a dem shader plugin, but no src included. Last edited by emufan; 21 July 2017 at 23:53. |
|
22 July 2017, 00:51 | #20 |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 719
|
In the zone, a new zip with hopefully a working demshade pluggin.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SAS C v6.50 | Avanaboy | request.Apps | 2 | 22 April 2012 02:48 |
Sas C 6.58 | AmiCoder | request.Apps | 3 | 06 February 2010 01:19 |
SAS/C v6.50 | zerostress | request.Apps | 3 | 08 October 2007 10:35 |
Sas C V 6.0 | Jherek Carnelia | request.Apps | 1 | 20 March 2007 10:13 |
Sas C | Scoglio | request.Apps | 0 | 28 October 2002 11:13 |
|
|