English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 05 August 2017, 22:12   #1
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
SAS/C and C++

this really is beyond any explaination to me:

SAS/C 6.58 or SAS/C 6.59

i have a cpp source, with class defintions and such stuff,
so if I build this thing, there is not a single of SAS/C's sccxx libraries invoked.
i removed/renamed all those scxx* libs and while building the c++ source,
I dont get any related error about a missing sccxx lib.

the binary gets linked with sc.lib and scm881.lib instead of sccxx.lib sccxxm881.lib
the resulting plugin just crashs lightwave.

the only thing I can see is this:
Code:
C++ Translator for "vmixer.cpp"
SAS/C C++ 9.99.99 (Mar  4 1998)
Copyright (c) 1996 SAS Institute Inc.
here are those sccxx libs:
Code:
 ls -l sc:lib/
-----rwed   16-04-29 08:51:42  276   141288 sccxx.lib
-----rwed   16-04-29 08:51:42   67    34304 sccxxm.lib
-----rwed   16-04-29 08:51:50   62    31468 sccxxm881.lib
-----rwed   16-04-29 08:51:48   66    33456 sccxxmieee.lib
-----rwed   16-04-29 08:51:44   68    34792 sccxxmnb.lib
-----rwed   16-04-29 08:51:44  281   143740 sccxxnb.lib

 ls -l sc:lib.701/
-----rwed   98-01-23 20:59:12  128    65256 sccxx.lib
-----rwed   98-01-23 20:59:12   38    19248 sccxxm.lib
-----rwed   98-01-23 20:59:12   31    15864 sccxxm881.lib
-----rwed   98-01-23 20:59:12   37    18456 sccxxmieee.lib
-----rwed   98-01-23 20:59:12   39    19612 sccxxmnb.lib
-----rwed   98-01-23 20:59:12  132    67392 sccxxnb.lib

 ls -l sc:libs/sccxx.library
-----rwed   98-03-04 18:54:46 2106  1078096 sccxx.library
from the SAS/C 6.50 manual:
Code:
sccxx.library
is required to compile any C+ + files,
my sccxx.library was renamed to sccxx.library-off --> not a single error about that.

it does this c++ to c translating, producing non working code.
while manualy rewriting the same code to C ( with help by alkis ) - i can build a working binary.

so from my understanding there is a c++ compiler, with some big c++ support libs,
which will never get used.

what is wrong here ?

Last edited by emufan; 05 August 2017 at 22:53.
emufan is offline  
Old 06 August 2017, 01:03   #2
kamelito
Zone Friend

kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,435
C++ was experimental see https://www.warped.com/amiga/
Kamelito
kamelito is offline  
Old 06 August 2017, 01:31   #3
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by kamelito View Post
C++ was experimental see https://www.warped.com/amiga/
Kamelito
thanks for the reply, but i found some sc command line options:
Code:
vmixer.o:
        sc cxxsrc $(CFLAGS) vmixer.cpp


SAS/C Amiga Compiler 6.59
Copyright (c) 1988-1995 SAS Institute Inc.

C++ Translator for "vmixer.cpp"
Error  : can't open sc:libs/sccxx.library

sc failed returncode 10
there are 3 c++ related options if sc: CXXSRC/K,CXXKEEP/S,CXXONLY/S

the first time it want sccxx.library

#1) one option keeps the converted c source. still not touching the scxx libs.
even experimental, they cannot deliver that lot of libs and they wont get used.
there must be something i'm doing wrong :/

Last edited by emufan; 06 August 2017 at 02:22.
emufan is offline  
Old 06 August 2017, 08:45   #4
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 47
Posts: 1,814
SAS/C doesn't support inheritance. The C++ support was not completed.
Samurai_Crow is offline  
Old 06 August 2017, 16:05   #5
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by Samurai_Crow View Post
SAS/C doesn't support inheritance. The C++ support was not completed.
hmmm, but what I do not understand, they dont use those c++ link lib files,
when building from a c++ src. allways linking the sc.lib.

there must be some switch to let the binary build using those c++ link libs.
but i cannot find any example doing so.
emufan is offline  
Old 06 August 2017, 18:05   #6
kamelito
Zone Friend

kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,435
The last SAS I have is 6.58, I can see that you've 6.59 is it available somewhere?
Kamelito
kamelito is offline  
Old 26 September 2017, 20:18   #7
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by kamelito View Post
The last SAS I have is 6.58, I can see that you've 6.59 is it available somewhere?
Kamelito
oh, sorry for delay.

#1) Unofficial Official SAS/C Compiler Support Page
- Experimental releases. 6.59 with template support

#2) on aminet Experimental SAS/C++ (requires SAS/C) - same as above

#3) there is an older version also on aminet.

but make a backup of your old sc folder, before patching.
emufan is offline  
Old 26 September 2017, 20:36   #8
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
does anyone know how to set a global definition with sas/c, sort of -DAMIGA done with gcc?
maybe something in SCOPTIONS file: "DEFINE AMIGA" ?

#1) another one: there is an already defined variable, i try to #undef
but #undef is ignored:
Code:
// Platform-Specific Filename Strings
#ifdef AMIGA
#undef DRIVE_SEPERATOR_CHAR
#undef DIR_SEPERATOR_CHAR
#undef DIR_SEPERATOR_STRING
  static const char   DRIVE_SEPERATOR_CHAR   = ':';
  static const char   DIR_SEPERATOR_CHAR     = '/';
  static const char * DIR_SEPERATOR_STRING   = "/";
#endif
why does #undef not work?

#2) found in the SCOPTIONS file of WCS amiga source code: DEFINE AMIGA
so this seems to be the solution.

Last edited by emufan; 26 September 2017 at 21:32.
emufan is offline  
Old 26 September 2017, 23:25   #9
kamelito
Zone Friend

kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,435
@emufan,
thanks
Kamelito
kamelito is offline  
Old 27 September 2017, 01:40   #10
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
Quote:
Originally Posted by kamelito View Post
thanks
np.

#1) I've another c++ src , does build but linking fails. maybe I forgot how to do it, but I cannot remember:
Code:
Undefined symbols        First Referenced
___vtbl_1__7filebuf      File 'Process.o'
Enter a DEFINE value for ___vtbl_1__7filebuf (default ___stub): 
_DoProcess               File 'AllKeyer.o'
Enter a DEFINE value for _DoProcess (default ___stub): 
___vtbl_0__9streambuf    File 'Process.o'
Enter a DEFINE value for ___vtbl_0__9streambuf (default ___stub):
filebuf and streambuf must be an include problem, src uses ofstream and ifstream,
includes fstream, iobase, iostream, stdiostream. but the failure persists.

DoProcess is a function in Process.cpp , which is called in Allkeyer.c.
there seems to be missing a definition/prototype in Allkey.c ?
i tried with extern int DoProcess (); but this does not work :/

#2) I put the code from AllKeyer.c into Process.cpp , so I got rid of the missing DoProcess definition.

but I still get:
Code:
___vtbl_1__7filebuf      File 'Process.o'
Enter a DEFINE value for ___vtbl_1__7filebuf (default ___stub): 
___vtbl_0__9streambuf    File 'Process.o'
Enter a DEFINE value for ___vtbl_0__9streambuf (default ___stub)
maybe it is missing some std:: kind of stuff somewhere?

#3) i've attached the whole src, in original state.
there must be some simple step to fix the linking stuff. alkis ?!

#4) the thing here seems to be missing functions from additonal object files.
below I try to compile the plugin version, here we have the cli tool.
below I've allready added 10 different object files to the project.
adding some does build the plugin ( with _stubs), adding another one, gives the above error.
Attached Files
File Type: lha AllKeyer-WIP.lha (4.9 KB, 94 views)

Last edited by emufan; 29 September 2017 at 13:53.
emufan is offline  
Old 28 September 2017, 18:15   #11
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
is there a SCOPTIONS value to suppress all warning, only list errors?
I tried with WARN=111, to only show warning number 111, but this does not work.
emufan is offline  
Old 28 September 2017, 20:56   #12
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
another one I do not understand, well, sas/c does not:
Code:
// at the begin of the src file:

const char *path;
...
[bool DirStrings::IsPathOnly( const char *path ) {
523: int end = strlen( path )-1;
524:  if ( (path[end] == ':' ) || (path[end] == '/' ) || (path[end] == '\\') )
525:  {
526:    return true;
527:  }
528:  return false;
529:}

and sas/c says this:

DirStrings.cc 524 Error 1200: Syntax error in declaration: found unexpected 'if'.
DirStrings.cc 524 Error 1200: Syntax error in declaration: found unexpected '=='.
DirStrings.cc 524 Error 1200: Syntax error in declaration: found unexpected '=='.
DirStrings.cc 524 Error 1200: Syntax error in declaration: found unexpected '=='.
what is wrong with this "if" line?

#1) a related error , also with path and strlen is here:
Code:
457: char * DirStrings::RemoveTrailingDirSeperator( char *path, bool any ) {
458:   int len = strlen( path );
459:
460:   if( path[len-1] == '/' )
461:   {
462:    path[len-1] = '\0' );
463:   }
464: return path;
465:}

DirStrings.cc 462 Error 1200: Syntax error: semi-colon expected.
what is worng here?

btw. these things build with AmiDevCpp (gcc 3.5) ...
but i have to use sas/c to build another plugin for lw - build with gcc does not work :/

#2) is there a function to find the last char in a string?
string::find_last_of is unknown to sas/c ...

#3) example in C#:
Code:
str = str.Remove(str.Length -1, 1) + ",";
i try to do something with strchr and strrchr

#4) *woah* "unexpected 'if' was caused by a comment line above the code:
Code:
//  Returns true if there is no :, / or \
last char wraped to the next line ... found it due to syntax highlighting in NotePad++

Last edited by emufan; 28 September 2017 at 21:46.
emufan is offline  
Old 03 December 2017, 21:20   #13
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,545
is there a SAS/C option which equals to gcc's -fpermissive?

#1) in sasc there is a link option ... startup=serv_s.o ...

how can I achieve the same with gcc? I link the whole thing with the following line:
Code:
	$(CC) $(LFLAGS) $(ULIB)serv_s.o $(OBJECTFILES) -o plugin.p \
		-L$(ULIB) $(ULIB)server.lib
does gcc takes "serv_s.o" as the startup-code or do I need to use another option?

Last edited by emufan; 04 December 2017 at 15:33.
emufan is offline  
 


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 6.58 on 1.3 marduk_kurios Coders. C/C++ 25 29 July 2018 19:17
SAS C 6.58 (again) nyteshade request.Other 2 15 December 2016 18:18
Sas/c Tiddlypeeps Coders. General 15 08 February 2010 01:32
Sas C 6.58 AmiCoder request.Apps 3 06 February 2010 02:19
SAS/C v6.50 zerostress request.Apps 3 08 October 2007 11:35

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:21.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.13856 seconds with 16 queries