forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using SCC

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Wed Sep 14, 2011 10:18 am    Post subject: Using SCC Reply with quote

Is it still advisable to use SCC in Plato, considering that its development has been frozen for a long time? We have a lecturer who wants to continue using it in his teaching, and had problems through the latest Plato 4.4.

So I ran an old C++ test program that I have run in the past successfully, but in the latest Plato it fails with access violation or runtime error. Its initial lines are:

#include <stdio.h> // for printf
#include <stdlib.h> // for atoi
#include <time.h> // for mktime etc.
#include <clib.h>

int main()
{
char *weekday[] = {" Sun"," Mon"," Tues"," Wednes",
" Thurs"," Fri"," Satur", "n unknown "};
char *str[10],za;
struct tm birth;

printf("Type in test character\n");
getch();

It writes out "Type in test character", but pressing any key in response makes the program crash.

Please note that I am not experienced in C/C++.

Thanks.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Wed Sep 14, 2011 12:41 pm    Post subject: Reply with quote

There is no reason why you should not continue to use SCC in Plato unless you need features of C++ that have not been implemented.

As you say, SCC has been frozen for some time now so C++ has moved on.

Your test program works OK for me. Try installing the Silverfrost personal edition on a local machine first of all to see if this works.
Back to top
View user's profile Send private message AIM Address
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Wed Sep 14, 2011 2:51 pm    Post subject: Reply with quote

Paul, thanks.

I have two different problems which, I believe, are related to drives. PCs mentioned below are Windows XP, 32 bit.

1. On a clean PC, I installed Plato in default C:\program files etc., and happened by chance to have the source C program (mentioned above) located on a mapped drive. It failed during execution with access violation. I moved the program to a folder under 'My Documents' , and it worked.

2. For our users we have Plato deployed through Microsoft APP-V, which means it appears as installed on a virtual drive V:\. On such a client PC, I launched the APP-V deployed Plato, and had the source file in C:\DIR. It failed with access violation.

So the program only worked when both Plato and the source file were on C:\.

3. A different program. I launched Plato as in (1), then went to "Help > SCC" and copied the example program for "gets":

// gets.cpp
#include <stdio.h> // for gets, etc.
int main()
{
char str[80];
printf("Input:\n");
do
{
gets(str);
puts(str);
} while (*str);
if (ferror(stdin)) printf("ERROR:Read error in gets\n");
return 0;
}

I saved the source under 'My Documents'. The program fails with access violation. I moved the sourse to C:\temp. The programs works fine.
Back to top
View user's profile Send private message
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Wed Sep 14, 2011 3:26 pm    Post subject: Reply with quote

I should mention that we don't get any such problems with FTN95 programs through Plato. The location of the installation or of the program source files doesn't cause any problems.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Wed Sep 14, 2011 3:59 pm    Post subject: Reply with quote

There should be no difference between FTN95 and SCC so I assume there is something different in your deployment.

Make sure that the access rights to all the files are the same for SCC as they are for FTN95.
Back to top
View user's profile Send private message AIM Address
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Wed Sep 14, 2011 4:03 pm    Post subject: Reply with quote

Our user had mentioned that these problems didn't occur in Plato3. So I got hold of v. 3.20 and installed it, and tried the same situation as (1) above. It worked.
Back to top
View user's profile Send private message
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Thu Sep 15, 2011 10:08 am    Post subject: Reply with quote

I have now simplified it to this. Here is an example program:

#include <iostream.h>

main()
{
int i,j;
cout << "Please enter 1st value" << endl;
cin >> i ;

cout << "Please enter 2nd value " << endl ;
cin >> j ;

cout << "First was " << i << endl ;
cout << "Second was " << j << endl ;
cout << "Sum is " << ( i+j) << endl ;

return 0;
}

It compiles, links and runs fine through Plato 3.20.

Through Plato 4.4, whether you re-compile and re-link it, or use the exe generated under Plato 3.20, when you run it, it outputs "Please enter 1st value", but typing a value and pressing return gives Run-time error.

Another difference is that under Plato 3.20 it outputs a line-break after "Please enter 1st value", but does not under Plato 4.4.

You can generate the exe under either 3.20 or 4.4, it doesn't matter. It's when you run it, that it works under 3.20 but fails under 4.4.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Thu Sep 15, 2011 10:48 am    Post subject: Reply with quote

The root of the problem will probably be either

a) some change affecting salflibc.dll or

b) a change in the way that Plato launches your executable.

You should be able to distiguish between these two by running the exe from a command prompt window rather than starting it up from Plato.
Back to top
View user's profile Send private message AIM Address
Zahid



Joined: 03 Feb 2005
Posts: 26

PostPosted: Thu Sep 15, 2011 11:07 am    Post subject: Reply with quote

The same problem arises from the command prompt. The exe works from the command prompt of the Plato 3.20 installation, but fails from 4.4.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7924
Location: Salford, UK

PostPosted: Thu Sep 15, 2011 7:41 pm    Post subject: Reply with quote

In which case, as far as SCC is concerned, you may be able to use the old salflibc.dll with the new Plato but keep a backup of the replaced dll.

I have just fixed a cout bug in salflibc.dll but I don't know how or when the regression occured.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group