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 

Static Libraries in Plato

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
Wolfgang Hoeppner



Joined: 05 Dec 2006
Posts: 8
Location: Sibiu / Romania

PostPosted: Fri Apr 13, 2007 5:50 pm    Post subject: Static Libraries in Plato Reply with quote

Dear friends of FTN95,

being a hobby programmer in Fortran (ephemeris calculation; planetary
theory) and rather a novice on Fortran 95, I have in the last weeks with
success converted some of my old programmes into such a mix of Fortran 77
and Fortran 95 that it could be accepted by the FTN95 compiler.

Of course, in those fields, there are many SUBROUTINEs and many FUNCTIONs
common to many PROGRAMs. The solution is, of course, a library. Up to
now, my Fortran 95 programmes are large source files which contain all of
the procedures + a MODULE file with the PARAMETERs of the KINDs, the
definitions of the dreived TYPEs (converted from the STRUCTUREs of
Microsoft Fortran Power Station), the variables of the former COMMONs and
the initializations from the former BLOCK DATA routines.

For the beginning, I have composed a Plato project for building a static
library, the source files of this project being that MODULE file and a file
containing a single SUBROUTINE. This works fine, the library has been
created. (But a little bit tricky: at the first choice the are only four
possibilities: Fortran or C++ applications or DLL's; nothing about LIB's.
But after creating the project one can click through the menues: Project
--> Set Target --> LIB!)

My problem now is: How can I use this library within a Plato project for
creating an EXE file? I have tried all (?) possibilities, but none with
success.

Project --> Properties --> Compiler Options --> Miscellaneous --> Extra
Compiler Options: I have typed in the statement /LIBRARY '<filename>' with
and without the quotation marks -- <filename> with the extension .LIB: the
unresolved external reference remains unresolved -- <filename> without the
extension .LIB: "unable to open <filename>".

Project --> Properties --> Linker Options --> Linker Options --> Extra
Linker Options: -load:<filename>: "Don't understand -load"; the keyword
"load" without hyphen or quite without this keyword, <filename> with or
without quotation marks, with or without the extension .LIB: the same
results as with the Extra Compiler Option.

LIBRARY '<filename>' directive in the source file: not possible without
the quotation marks, but with and without the extension .LIB: the
unresolved external reference remains unresolved. I have put the LIBRARY
directive into the main programme after the declarations, before the first
executable statement: is this the wrong place for the LIBRARY directive?
-- By the way, I don't like very much FTN95's LIBRARY directive, because it
is far from standard Fortran.

Can somebody help me with this probably not too hard problem? I don't like
to begin with using FTN95 from the command line -- I would like to build my
programmes within Plato, first of all because of its debug possibilities.

With thanks for your help and best wishes,

Wolfgang Höppner.

Back to top
View user's profile Send private message Send e-mail Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sat Apr 14, 2007 6:55 am    Post subject: Reply with quote

There are two approaches that should work, one you have mentioned.

1. Use the Project References (in the Project Explorer window) to add a reference to the library. This will automatically use the full path of the library.

2. Put the name of the library into Project --> Properties --> Linker Options --> Linker Options --> Extra Linker Options. You may need add the .lib extension but no prefix (-load etc). You may need to provide the full path or experiment by copying the library into a few places where the linker might expect to find it.

If you cannot get this to work, let me know and I will run one or two tests for you.
Back to top
View user's profile Send private message AIM Address
Wolfgang Hoeppner



Joined: 05 Dec 2006
Posts: 8
Location: Sibiu / Romania

PostPosted: Fri May 11, 2007 4:05 pm    Post subject: Re: Reply with quote

[quote="PaulLaidler"]There are two approaches that should work, one you have mentioned.

1. Use the Project References (in the Project Explorer window) to add a reference to the library. This will automatically use the full path of the library.

2. Put the name of the library into Project --> Properties --> Linker Options --> Linker Options --> Extra Linker Options. You may need add the .lib extension but no prefix (-load etc). You may need to provide the full path or experiment by copying the library into a few places where the linker might expect to find it.

If you cannot get this to work, let me know and I will run one or two tests for you.[/code]


Dear Mr Laidler,

Thank you very much for your advice. The first method works fine: to put
the name of the library under "References".

Exactly this is stated on the Help page titled "A simple Fortran project",
but unfortunately, it has not been repeated on the pages dealing with
creating and using libraries.

But now, in building my library, I have encountered another problem, for
which I'll start another subject: "Within Plato3, is the number of source
files limited?"

Yours sincerely,

Wolfgang Höppner
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Wolfgang Hoeppner



Joined: 05 Dec 2006
Posts: 8
Location: Sibiu / Romania

PostPosted: Fri May 11, 2007 4:06 pm    Post subject: Re: Static Libraries Reply with quote

Dear Mr Laidler,

Thank you very much for your advice. The first method works fine: to put
the name of the library under "References".

Exactly this is stated on the Help page titled "A simple Fortran project",
but unfortunately, it has not been repeated on the pages dealing with
creating and using libraries.

But now, in building my library, I have encountered another problem, for
which I'll start another subject: "Within Plato3, is the number of source
files limited?"

Yours sincerely,

Wolfgang Höppner.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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