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 

Calling the Wrong Version of ftn95 executable

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Mar 05, 2015 5:49 pm    Post subject: Calling the Wrong Version of ftn95 executable Reply with quote

An habitual problem I have on my machine is the following:

I have FTN95 personal v7.0 installed and ALSO FTN Express (which is essentially FTN95 v5.4 - until we get an update Sad).
Now, when I run FTN95 in command line mode it habitually runs v5.4 and not the v7.0 installed.
Obviously it's related to the PATH Environment variables set-up.
I've tried simply re-running the 'fvar.bat' file (the v7.00 one because remember the Express .bat file doesn't work correctly !) but it still persists in calling effectively the FTN95 Express v5.4 executable on compiling.

So, my questions are:-

a) how do I change the default back to call FTN95 v7 (the Personal version I have installed) bearing in mind that simply re-running the .bat doesn't work alone?
In fact, going one step further, how (if it's possible) can I set up my system to run BOTH Personal and Express versions without having to run from the installed directory or copy the relevant .exe, .dll, .lib files every time ?

b) what exactly is the relationship between ftn95.exe, salflibc.dll and salflibc.lib ? ... and when a new release comes out what changes (generally speaking) in each ?

This question came into my mind because:-

i) when the recent beta version was released it became apparent (in the discussion in the related post) that one actually needs to copy both the new .dll AND the new .lib files to the program directory. For me at least this wasn't clear previously.

ii) By accident I came across a comment from Eddie (LitusSaxonicus) in a nearly 2 year old post (http://forums.silverfrost.com/viewtopic.php?t=2570&highlight=sendmessage) about a previous beta-release where, regarding a specific problem he had, he said:

"It occurs to me that I don't understand what salflibc.lib does. Is my problem this lack of understanding? If so, please help!
The beta download salflibc.lib is also in the directory with the sources and executable."

.... whilst it gives some comfort to me that even experienced users like Eddie are sometimes flummoxed just like me by the workings of ftn95,
I didn't see any comment to his cry for help there. I guess I'm saying 'Please help !' too now.


Suggestions for New Forums 'Categories'
Finally, re- Clearwin+ BETA releases .... I was surprised to find the post about the BETA release in the CLEARWIN forum section, wouldn't it be a good idea to put them in the 'Announcements' section too (with a link to the CLEARWIN discussion post too) ? ... or create a seperate forum for Beta -releases ... and also a seperate one for FTN95 64 bit Discussions too (as I think I suggested somewhere else too previously) - at the moment all discussion on that is in a single post which is .... oh I've forgotten where !!
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Mar 05, 2015 6:23 pm    Post subject: Reply with quote

You will need to know the path (i.e. the folder) for each version of FTN95.
You will also need to know the current PATH environment variable and how to change it.

By default, the version of FTN95 that is used will be the one that occurs first in the list of folders that appear in the PATH environment variable.

Some of the details depend on which operating system you are running so try asking Google using this information. For example "How do I change the PATH environment variable under Windows 7".

When working from a command line in a "Command Prompt" window you can create and use a batch file to set the PATH. But editors like Visual Studio and Plato will compile etc using a background process (in effect its own temporary Command Prompt window) where (by default) the default PATH will be used. There are lots more caveats but hopefully you will get the drift.
Back to top
View user's profile Send private message AIM Address
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Mar 05, 2015 9:10 pm    Post subject: Reply with quote

Thanks Paul,
I'll have to try the fvars.bat (_I'm using the one in the installed directory) in command line (I was double-clicking the file to run it).
Seems I'll need to set up something a bit sophisticated to allow both versions to be accessible 8also useful for example for testing Beta Versions alongside production versions instead of 'replacing' dll's lib' and exe's .....

You didn't reply to Question b) by the way.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Fri Mar 06, 2015 1:25 am    Post subject: Reply with quote

John,

You must have the 2 different versions installed in different directories. (I have at least 4 different versions which I can switch between, as well as other compilers.)

To switch, all you need to do is have a different .bat file for each version and ensure that you have the correct environment variables set (by activating this .bat file in your cmd.exe window.)

To overcome this problem, be aware of where each version is stored, especially where each version of salflibc.dll is stored.

Then review the default settings by using the command SET and see what environment variables default to and which are related to FTN95. You can then create your own "fvars.bat" file for each version (with a unique name) and then all should be ok.
I create an environment variable for the ftn95 directory I want to use, but you then must update the path.

My example minimal .bat file for win_7 is:
Code:

set ftn95_dir=C:\Program Files (x86)\Silverfrost\FTN95
f95include=%ftn95_dir%\include
mod_path=%ftn95_dir%\include
set path=%ftn95_dir%;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem

(you can add extra paths into the path variable as you require. This can become a very long string!)

The next problem to be aware of is there is a default path ( as seen in "set path") and this is what will be used before you change it, ie this will select the version of salflibc.dll used by all your ftn95 compiled programs before you change the path.

You can change the default (for Win_7) by editing path in:
Control_Panel > System > Advanced system settings > advanced >Environment Variables.
select Path then edit ( You may want to copy the string to notepad to edit then paste the update back, as the edit box is a bit small ! Don't get this wrong. )

Once you understand the use of path, it becomes quite easy. Using new variable names in the bat file is a big help, such as ftn95_dir or gcc_dir all help.
Other compilers have much more complex .bat to select different versions, such as including the use of visual studio versions or 32/64 bit selection.
Fortunately FTN95 does not require the use of regedit, which is another level of complexity that removes a lot of the flexibility that is in the environment variable approach ( Plato does )

Also, double clicking a .bat file in windows explorer may not do any good, as when it closes, all it's settings are lost. You need to understand the "scope" of the .bat file settings.

John
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ 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